Commit 228297d51e942c53c949a2d74b60a400c058b84d
Exists in
master
Merge remote-tracking branch 'origin/tarefa-4466' into desenvolvimento
Showing
3 changed files
with
129 additions
and
87 deletions
Show diff stats
cit-ecm-web/src/main/java/br/com/centralit/listener/StartupListenerEcm.java
... | ... | @@ -411,6 +411,7 @@ public class StartupListenerEcm extends UtilStartup implements ApplicationListen |
411 | 411 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.TIPO_ASSINATURA", "Tipo de assinatura", dominio, modulo)); |
412 | 412 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.CONTEUDO_HTML", "Conteúdo HTML", dominio, modulo)); |
413 | 413 | internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.REMOVER_IMAGEM", "Remover imagem", dominio, modulo)); |
414 | + internacionalizacaoList.add(new Internacionalizacao("ECM.LABEL.CAMPOS_DINAMICOS", "Campos Dinâmicos", dominio, modulo)); | |
414 | 415 | } |
415 | 416 | |
416 | 417 | /** | ... | ... |
cit-ecm-web/src/main/webapp/assets/js/angular/custom/controller/TarjaAssinaturaController.js
... | ... | @@ -18,12 +18,12 @@ citApp.controller('TarjaAssinaturaController', |
18 | 18 | |
19 | 19 | $scope.resetForm = function() { |
20 | 20 | |
21 | - if($scope.tarjaAssinatura) { | |
22 | - var originalTipoAssinatura = $scope.tarjaAssinatura.tipoAssinatura; | |
23 | - $scope.tarjaAssinatura = { | |
24 | - tipoAssinatura : originalTipoAssinatura | |
25 | - } | |
26 | - } | |
21 | + if($scope.tarjaAssinatura) { | |
22 | + var originalTipoAssinatura = $scope.tarjaAssinatura.tipoAssinatura; | |
23 | + $scope.tarjaAssinatura = { | |
24 | + tipoAssinatura : originalTipoAssinatura | |
25 | + } | |
26 | + } | |
27 | 27 | |
28 | 28 | if ($scope.uploaderLogo){ |
29 | 29 | $scope.uploaderLogo.clearQueue(); |
... | ... | @@ -77,25 +77,25 @@ citApp.controller('TarjaAssinaturaController', |
77 | 77 | $scope.edit= false |
78 | 78 | } |
79 | 79 | |
80 | - $scope.fetchResult = function(){ | |
81 | - angular.element('#searchTarjaAssinatura').scope().fetchResult(); | |
82 | - }; | |
83 | - | |
84 | - $scope.removeImagem = function (){ | |
85 | - if($scope.tarjaAssinatura.anexoImagem){ | |
86 | - TarjaAssinaturaRepository.removeImagem($scope.tarjaAssinatura).then(function (result) { | |
87 | - $scope.tarjaAssinatura = result.originalElement; | |
88 | - if($scope.uploaderLogo.queue.length > 0){ | |
89 | - $scope.uploaderLogo.clearQueue(); | |
90 | - } | |
91 | - }) | |
92 | - } | |
93 | - } | |
94 | - $scope.openFile = function () { | |
95 | - if($scope.edit){ | |
96 | - angular.element('#uploadLogoTarjaAssinatura').trigger('click'); | |
97 | - } | |
98 | - } | |
80 | + $scope.fetchResult = function(){ | |
81 | + angular.element('#searchTarjaAssinatura').scope().fetchResult(); | |
82 | + }; | |
83 | + | |
84 | + $scope.removeImagem = function (){ | |
85 | + if($scope.tarjaAssinatura.anexoImagem){ | |
86 | + TarjaAssinaturaRepository.removeImagem($scope.tarjaAssinatura).then(function (result) { | |
87 | + $scope.tarjaAssinatura = result.originalElement; | |
88 | + if($scope.uploaderLogo.queue.length > 0){ | |
89 | + $scope.uploaderLogo.clearQueue(); | |
90 | + } | |
91 | + }) | |
92 | + } | |
93 | + } | |
94 | + $scope.openFile = function () { | |
95 | + if($scope.edit){ | |
96 | + angular.element('#uploadLogoTarjaAssinatura').trigger('click'); | |
97 | + } | |
98 | + } | |
99 | 99 | |
100 | 100 | //INSTANCIA DO OBJETO PARA FAZER UPLOAD |
101 | 101 | $scope.uploaderLogo = new FileUploader({ |
... | ... | @@ -152,19 +152,22 @@ citApp.controller('TarjaAssinaturaController', |
152 | 152 | }; |
153 | 153 | |
154 | 154 | $scope.getTarjaAssinatura = function(id, edit) { |
155 | - $scope.resetForm(); | |
156 | - $scope.setLoadingGet(true); | |
157 | - TarjaAssinaturaRepository.get(id).then(function(result) { | |
158 | - $scope.tarjaAssinatura = result.originalElement; | |
159 | - vincularIdTarjaUploader(); | |
160 | - $scope.edit = edit; | |
161 | - $scope.setLoading(false); | |
162 | - }); | |
163 | - }; | |
155 | + $scope.setLoadingGet(true); | |
156 | + TarjaAssinaturaRepository.get(id).then(function(result) { | |
157 | + $scope.tarjaAssinatura = result.originalElement; | |
158 | + vincularIdTarjaUploader(); | |
159 | + $scope.edit = edit; | |
160 | + $scope.setLoading(false); | |
161 | + }); | |
162 | + }; | |
164 | 163 | |
165 | 164 | var vincularIdTarjaUploader = function () { |
166 | - if($scope.tarjaAssinatura.id){ | |
167 | - $scope.uploaderLogo.url += $scope.tarjaAssinatura.id; | |
168 | - } | |
165 | + if($scope.tarjaAssinatura.id){ | |
166 | + $scope.uploaderLogo.url += $scope.tarjaAssinatura.id; | |
167 | + } | |
169 | 168 | }; |
169 | + | |
170 | + $scope.insertTextEditor = function(button){ | |
171 | + CKEDITOR.instances.editorConteudo.insertText(button); | |
172 | + } | |
170 | 173 | }]); | ... | ... |
cit-ecm-web/src/main/webapp/html/tarjaAssinatura/tarjaAssinaturaEdit.html
... | ... | @@ -38,62 +38,100 @@ |
38 | 38 | <legend> |
39 | 39 | <translate>ECM.LABEL.DADOS_TARJA_ASSINATURA</translate> |
40 | 40 | </legend> |
41 | - </fieldset> | |
42 | - <p><small>( <span class="red">*</span> ) <translate>LABEL.CAMPOS_OBRIGATORIOS</translate></small></p> | |
43 | - <div class="row"> | |
44 | - <div class="col-md-6"> | |
45 | - <label-input ng-id="tarjaAssinatura.descricao" ng-label="LABEL.DESCRICAO" ng-type="text" | |
46 | - ng-model="tarjaAssinatura.descricao" form="tarjaAssinaturaForm" ng-obrigatorio="true" | |
47 | - ng-custom-maxlength="100" ng-type="text" ng-disabled="!edit" /> | |
48 | - </div> | |
49 | - <div class="col-md-4"> | |
50 | - <label-input ng-id="tarjaAssinatura.tipoAssinatura" ng-label="ECM.LABEL.TIPO_ASSINATURA" ng-type="text" | |
51 | - ng-disabled="true" ng-model="tarjaAssinatura.tipoAssinatura.descricao" form="tarjaAssinaturaForm" | |
52 | - ng-obrigatorio="false" ng-type="text" /> | |
41 | + | |
42 | + <p><small>( <span class="red">*</span> ) <translate>LABEL.CAMPOS_OBRIGATORIOS</translate></small></p> | |
43 | + <div class="row"> | |
44 | + <div class="col-md-6"> | |
45 | + <label-input ng-id="tarjaAssinatura.descricao" ng-label="LABEL.DESCRICAO" ng-type="text" | |
46 | + ng-model="tarjaAssinatura.descricao" form="tarjaAssinaturaForm" ng-obrigatorio="true" | |
47 | + ng-custom-maxlength="100" ng-type="text" ng-disabled="!edit" /> | |
48 | + </div> | |
49 | + <div class="col-md-4"> | |
50 | + <label-input ng-id="tarjaAssinatura.tipoAssinatura" ng-label="ECM.LABEL.TIPO_ASSINATURA" ng-type="text" | |
51 | + ng-disabled="true" ng-model="tarjaAssinatura.tipoAssinatura.descricao" form="tarjaAssinaturaForm" | |
52 | + ng-obrigatorio="false" ng-type="text" /> | |
53 | + </div> | |
53 | 54 | </div> |
54 | - </div> | |
55 | - <div class="row"> | |
56 | - <div class="col-sm-12"> | |
57 | - <div class="form-group" ng-disable="!edit"> | |
58 | - <label class="control-label"><translate>ECM.LABEL.LOGO_TARJA_ASSINATURA</translate></label> | |
59 | - <div ng-if="tarjaAssinatura.anexoImagem.anexo == undefined" nv-file-drop="" uploader="uploaderLogo" ng-click="openFile();"> | |
60 | - <div nv-file-over="" uploader="uploaderLogo" over-class="another-file-over-class" class="well my-drop-zone"> | |
61 | - <span ng-show="uploaderLogo.queue.length <= 0"><translate>MSG.ARRASTE_SOLTE_ARQUIVO</translate></span> | |
62 | - <span ng-show="uploaderLogo.queue.length > 0">{{uploaderLogo.queue[0].file.name}}</span> | |
55 | + <div class="row"> | |
56 | + <div class="col-sm-12"> | |
57 | + <div class="form-group" ng-disable="!edit"> | |
58 | + <label class="control-label"><translate>ECM.LABEL.LOGO_TARJA_ASSINATURA</translate></label> | |
59 | + <div ng-if="tarjaAssinatura.anexoImagem.anexo == undefined" nv-file-drop="" uploader="uploaderLogo" ng-click="openFile();"> | |
60 | + <div nv-file-over="" uploader="uploaderLogo" over-class="another-file-over-class" class="well my-drop-zone"> | |
61 | + <span ng-show="uploaderLogo.queue.length <= 0"><translate>MSG.ARRASTE_SOLTE_ARQUIVO</translate></span> | |
62 | + <span ng-show="uploaderLogo.queue.length > 0">{{uploaderLogo.queue[0].file.name}}</span> | |
63 | + </div> | |
63 | 64 | </div> |
64 | - </div> | |
65 | - <input id="uploadLogoTarjaAssinatura" type="file" nv-file-select="" uploader="uploaderLogo" ng-show="false" /> | |
66 | - </div><!-- .form-group --> | |
65 | + <input id="uploadLogoTarjaAssinatura" type="file" nv-file-select="" uploader="uploaderLogo" ng-show="false" /> | |
66 | + </div><!-- .form-group --> | |
67 | + </div> | |
67 | 68 | </div> |
68 | - </div> | |
69 | - <div class="row"> | |
70 | - <div class="col-sm-12" ng-show="tarjaAssinatura.anexoImagem.anexo"> | |
71 | - <img ng-src="data:image/JPEG;base64,{{tarjaAssinatura.anexoImagem.anexo}}" class="img-thumbnail" style="max-width: 300px; height: auto;"> | |
69 | + <div class="row" > | |
70 | + <div class="col-sm-12" ng-show="tarjaAssinatura.anexoImagem.anexo"> | |
71 | + <img ng-src="data:image/JPEG;base64,{{tarjaAssinatura.anexoImagem.anexo}}" class="img-thumbnail" style="max-width: 300px; height: auto;"> | |
72 | + </div> | |
72 | 73 | </div> |
73 | - </div> | |
74 | - </br> | |
75 | - <div class="row"> | |
76 | - <div class="col-sm-2" ng-show="tarjaAssinatura.anexoImagem.anexo && edit"> | |
77 | - <button class="btn btn-warning" ng-click="removeImagem()"> | |
78 | - <translate>ECM.LABEL.REMOVER_IMAGEM</translate> | |
79 | - </button> | |
74 | + <div class="row" style="margin-top: 10px;"> | |
75 | + <div class="col-sm-2" ng-show="tarjaAssinatura.anexoImagem.anexo && edit"> | |
76 | + <button class="btn btn-warning" ng-click="removeImagem()"> | |
77 | + <translate>ECM.LABEL.REMOVER_IMAGEM</translate> | |
78 | + </button> | |
79 | + </div> | |
80 | 80 | </div> |
81 | - </div> | |
82 | - </br> | |
83 | - <div class="row"> | |
84 | - <div class="col-md-12"> | |
85 | - <div class="form-group"> | |
86 | - <label class="control-label block" ng-class="{'has-error': !tarjaAssinatura.conteudo && tarjaAssinaturaForm.$submitted}"> | |
87 | - <translate>ECM.LABEL.CONTEUDO_HTML</translate> <span class="red">*</span> | |
88 | - <i ng-show="!tarjaAssinatura.conteudo && tarjaAssinaturaForm.$submitted" class='fa fa-warning red' | |
89 | - tooltip="{{$translate.instant('ECM.LABEL.CONTEUDO_HTML') + ' ' +$translate.instant('LABEL.CAMPO_OBRIGATORIO')}}" | |
90 | - tooltip-placement='top'></i> | |
91 | - </label> | |
92 | - <div id="tarjaAssinatura.conteudo" ckeditor="options" ng-if='edit' ready="onReady()" ng-model="tarjaAssinatura.conteudo" ></div> | |
93 | - <iframe id="visualizacaoConteudoTarjaAssinatura" srcdoc="{{tarjaAssinatura.conteudo}}" | |
94 | - allowfullscreen class="iframe-report" ng-show="!edit" style="min-height: 100px !important;"></iframe> | |
81 | + <div class="row" style="margin-top: 10px;" ng-show="edit"> | |
82 | + <div class="col-md-12"> | |
83 | + <label class="control-label"><translate>ECM.LABEL.CAMPOS_DINAMICOS</translate></label> | |
95 | 84 | </div> |
96 | 85 | </div> |
97 | - </div> | |
86 | + <div class="row" style="margin-top: 10px;" ng-show="edit"> | |
87 | + <div class="col-md-2"> | |
88 | + <div ng-init="btnLogo='@logo@';"> | |
89 | + <button ng-attr-id="btnLogo" class="btn btn-default btn-block" ng-click="insertTextEditor(btnLogo)">@logo@</button> | |
90 | + </div> | |
91 | + </div> | |
92 | + <div class="col-md-2"> | |
93 | + <div ng-init="btnNomeAssinante='@nome_assinante@';"> | |
94 | + <button ng-attr-id="btnNomeAssinante" class="btn btn-default btn-block" ng-click="insertTextEditor(btnNomeAssinante)">@nome_assinante@</button> | |
95 | + </div> | |
96 | + </div> | |
97 | + <div class="col-md-2"> | |
98 | + <div ng-init="btnFuncaoAssinante='@funcao_assinante@';"> | |
99 | + <button ng-attr-id="btnFuncaoAssinante" class="btn btn-default btn-block" ng-click="insertTextEditor(btnFuncaoAssinante)">@funcao_assinante@</button> | |
100 | + </div> | |
101 | + </div> | |
102 | + </div> | |
103 | + <div class="row" style="margin-top: 10px;" ng-show="edit"> | |
104 | + <div class="col-md-2"> | |
105 | + <div ng-init="btnDataAssinatura='@data_assinatura@';"> | |
106 | + <button ng-attr-id="btnDataAssinatura" class="btn btn-default btn-block" ng-click="insertTextEditor(btnDataAssinatura)">@data_assinatura@</button> | |
107 | + </div> | |
108 | + </div> | |
109 | + <div class="col-md-2"> | |
110 | + <div ng-init="btnHoraAssinatura='@hora_assinatura@';"> | |
111 | + <button ng-attr-id="btnHoraAssinatura" class="btn btn-default btn-block" ng-click="insertTextEditor(btnHoraAssinatura)">@hora_assinatura@</button> | |
112 | + </div> | |
113 | + </div> | |
114 | + <div class="col-md-2"> | |
115 | + <div ng-init="btnCodigoAssinatura='@codigo_assinatura@';"> | |
116 | + <button ng-attr-id="btnCodigoAssinatura" class="btn btn-default btn-block" ng-click="insertTextEditor(btnCodigoAssinatura)">@codigo_assinatura@</button> | |
117 | + </div> | |
118 | + </div> | |
119 | + </div> | |
120 | + <div class="row" style="margin-top: 10px;"> | |
121 | + <div class="col-md-12"> | |
122 | + <div class="form-group"> | |
123 | + <label class="control-label block" ng-class="{'has-error': !tarjaAssinatura.conteudo && tarjaAssinaturaForm.$submitted}"> | |
124 | + <translate>ECM.LABEL.CONTEUDO_HTML</translate> <span class="red">*</span> | |
125 | + <i ng-show="!tarjaAssinatura.conteudo && tarjaAssinaturaForm.$submitted" class='fa fa-warning red' | |
126 | + tooltip="{{$translate.instant('ECM.LABEL.CONTEUDO_HTML') + ' ' +$translate.instant('LABEL.CAMPO_OBRIGATORIO')}}" | |
127 | + tooltip-placement='top'></i> | |
128 | + </label> | |
129 | + <div id="editorConteudo" ckeditor="options" ng-if='edit' ready="onReady()" ng-model="tarjaAssinatura.conteudo" ></div> | |
130 | + <iframe id="visualizacaoConteudoTarjaAssinatura" srcdoc="{{tarjaAssinatura.conteudo}}" | |
131 | + allowfullscreen class="iframe-report" ng-show="!edit" style="min-height: 100px !important;"></iframe> | |
132 | + </div> | |
133 | + </div> | |
134 | + </div> | |
135 | + </fieldset> | |
98 | 136 | </form> |
99 | 137 | </div><!-- .page-content --> | ... | ... |