From 02f201408e17e6ca666815030a7ed6d253475ace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Maur=C3=ADcio?= Date: Wed, 28 May 2014 11:07:03 +0000 Subject: [PATCH] Partials. git-svn-id: https://svn.coded.pt/svn/SIPRP@1921 bb69d46d-e84e-40c8-a05a-06db0d633741 --- .../static/html/app/Form2/Form2Controller.js | 2 + .../static/html/app/Form2/Form2View.html | 55 +--------------- .../static/html/app/Form3/Form3View.html | 55 +--------------- .../static/html/app/Form4/Form4View.html | 55 +--------------- .../static/html/app/Main/MainController.js | 1 + .../html/app/SearchForm/SearchController.js | 4 +- .../html/app/directives/partialsRenderer.js | 40 ++++++++++++ .../html/app/partials/DadosTrabalhador-1.html | 64 +++++++++++++++++++ .../WebContent/static/html/index.html | 1 + 9 files changed, 113 insertions(+), 164 deletions(-) create mode 100755 trunk/SiprpWebFichasClinicas/WebContent/static/html/app/directives/partialsRenderer.js create mode 100644 trunk/SiprpWebFichasClinicas/WebContent/static/html/app/partials/DadosTrabalhador-1.html diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2Controller.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2Controller.js index c5c446fd..9d28e7aa 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2Controller.js +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2Controller.js @@ -159,6 +159,8 @@ if(tipo_ficha_id){ + $scope.motivos.items = []; + $scope.storeDadosFicha.extraParams = { tipoFichaID: tipo_ficha_id }; diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2View.html b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2View.html index d9a2b7a3..c3db4116 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2View.html +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2View.html @@ -20,60 +20,7 @@
-
-
- -
- -
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
- -
- -
- -
-
- -
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
- -
- -
-
+
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form3/Form3View.html b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form3/Form3View.html index b7afdf0c..521dff2f 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form3/Form3View.html +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form3/Form3View.html @@ -20,60 +20,7 @@ -
-
- -
- -
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
- -
- -
- -
-
- -
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
- -
- -
-
+
Motivo do Exame
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form4/Form4View.html b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form4/Form4View.html index ac083d92..3c889f75 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form4/Form4View.html +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form4/Form4View.html @@ -20,60 +20,7 @@ -
-
- -
- -
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
- -
- -
- -
-
- -
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
- -
- -
-
+
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Main/MainController.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Main/MainController.js index d660d3a9..95f9ac4d 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Main/MainController.js +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Main/MainController.js @@ -9,6 +9,7 @@ destroy: 'doLogout' } }); + $scope.storeUserSession.broadcastEvents = true; //will contain all user session info ... diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchController.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchController.js index 449a9ef9..d23f04d3 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchController.js +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchController.js @@ -165,8 +165,8 @@ }); }; - $scope.$on('afterrender', function(event, args){ - + $scope.$on('afterrender', function(event, args){ + $scope.comboEmpresas.loadStore(function(response, status, headers, config, items){ }); diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/directives/partialsRenderer.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/directives/partialsRenderer.js new file mode 100755 index 00000000..ea44d69a --- /dev/null +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/directives/partialsRenderer.js @@ -0,0 +1,40 @@ + +// usage: + +evoapp.directive('partialsRenderer', function($rootScope, $compile) { + + return { + restrict: 'AE', + link: function (scope, elem, attrs) { + + scope.partialId = attrs.partialId || null; + + if(scope.partialId != null){ + + var partialEL = $rootScope.viewCache.find('[id=' + scope.partialId + ']'); + + if(partialEL.length == 0){ + throw Error('partial ' + scope.partialId + ' not found!'); + }else{ + + if(partialEL.length > 1){ + throw Error('more than one partial ' + scope.partialId + ' was found!'); + }else{ + + var finalEl = $.parseHTML(partialEL.html()); + + $(finalEl).insertAfter(elem); + + elem.remove(); + + $compile(finalEl)(scope); + } + } + + } + + + + } + } +}); \ No newline at end of file diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/partials/DadosTrabalhador-1.html b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/partials/DadosTrabalhador-1.html new file mode 100644 index 00000000..6223a36b --- /dev/null +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/partials/DadosTrabalhador-1.html @@ -0,0 +1,64 @@ + +
+ +
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+ +
\ No newline at end of file diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/index.html b/trunk/SiprpWebFichasClinicas/WebContent/static/html/index.html index ea256b2e..1ebc0862 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/index.html +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/index.html @@ -126,6 +126,7 @@ +