Rev 1711 | Rev 1717 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1692 | jmachado | 1 | <%@ page import="jomm.dao.impl.AbstractDao" %> |
2 | <%@ page import="org.json.JSONArray" %> |
||
3 | <%@ page import="pt.estgp.estgweb.domain.RepositoryDocumentInterfaceImpl" %> |
||
4 | <%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %> |
||
5 | <%@ page import="pt.estgp.estgweb.services.data.repositorydocuments.RepositoryDocumentService" %> |
||
6 | <%@ page import="pt.estgp.estgweb.services.data.repositorydocuments.interfaces.RepositoryInterface" %> |
||
1683 | jmachado | 7 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
8 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
||
9 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
||
10 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
||
11 | <%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %> |
||
12 | <%@ taglib tagdir="/WEB-INF/tags" prefix="bacoTags" %> |
||
13 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
||
1692 | jmachado | 14 | |
15 | <% |
||
16 | |||
17 | long id = Long.parseLong(request.getParameter("id")); |
||
18 | |||
19 | |||
20 | AbstractDao.getCurrentSession().beginTransaction(); |
||
21 | |||
22 | JSONArray collectionsArrayOrderedTree = new RepositoryDocumentService().loadCollectionsOrderedAsTree(); |
||
23 | RepositoryDocumentInterfaceImpl repoInterface = (RepositoryDocumentInterfaceImpl) DaoFactory.getRepositoryDocumentInterfaceDaoImpl().get(id); |
||
24 | RepositoryInterface repositoryInterface = repoInterface.getRepositoryInterface(); |
||
25 | if(repositoryInterface == null) |
||
1683 | jmachado | 26 | { |
1692 | jmachado | 27 | repositoryInterface = new RepositoryInterface(); |
28 | repoInterface.setRepositoryInterface(repositoryInterface); |
||
1683 | jmachado | 29 | } |
1692 | jmachado | 30 | String jsonData = repositoryInterface.toJson(); |
31 | |||
32 | |||
33 | AbstractDao.getCurrentSession().getTransaction().commit(); |
||
34 | %> |
||
35 | |||
1683 | jmachado | 36 | <div class="container-fluid"> |
37 | |||
38 | <div id="treeAppPageContent" ng-app="treeAppPageContent" ng-controller="treeAppPageContentController"> |
||
39 | |||
40 | |||
41 | <script> |
||
42 | ping(); |
||
1692 | jmachado | 43 | |
44 | |||
45 | |||
1683 | jmachado | 46 | var treeAppPageContent = angular.module('treeAppPageContent', ['ui.tree']); |
47 | GLOBAL_BacoAngularAppDependencies.push('treeAppPageContent'); |
||
48 | |||
49 | <!-- estes codigos todos do remove e do toggle e etc's não mechi em nada limitei-me a copiar dos gajos--> |
||
50 | treeAppPageContent.controller('treeAppPageContentController', function ($scope) { |
||
51 | |||
1692 | jmachado | 52 | /*$scope.data = { |
1683 | jmachado | 53 | "showTitle" : true, |
54 | "showDescription" : false |
||
1692 | jmachado | 55 | };*/ |
56 | //$scope.myDate = new Date(); |
||
57 | //$scope.data = {"description":"RepoDesc","rows":[{"columns":[{"blocks":[{"collectionIds":[1],"description":"bloco1desc","maxPublishDate":'2015-12-15T23:00:00.000Z',"maxPublishDateStr":"","minPublishDate":null,"minPublishDateStr":"","orderBy":"publishDateDesc","showDescription":false,"showDocumentDescription":true,"showDocumentMetaData":false,"showDocumentTitle":true,"showFileDescription":false,"showFileTitle":true,"showTitle":true,"title":"bloco1","tree":false,"type":"block"}],"cols":6,"description":"col1Desc","rows":[],"showDescription":false,"showTitle":true,"title":"col1Title","type":"column"},{"blocks":[{"collectionIds":[4],"description":"bloco2desc","maxPublishDate":null,"maxPublishDateStr":"","minPublishDate":null,"minPublishDateStr":"","orderBy":"title","showDescription":false,"showDocumentDescription":true,"showDocumentMetaData":false,"showDocumentTitle":true,"showFileDescription":false,"showFileTitle":true,"showTitle":true,"title":"bloco2","tree":false,"type":"block"}],"cols":6,"description":"col2Desc","rows":[],"showDescription":false,"showTitle":true,"title":"col2Title","type":"column"}],"description":"Row 1 Desc","showDescription":false,"showTitle":true,"title":"Row 1 title","type":"row"}],"showDescription":true,"showTitle":true,"title":"Teste"} |
||
58 | $scope.data = <%=jsonData%> |
||
59 | ; |
||
60 | $scope.collections = <%=collectionsArrayOrderedTree.toString()%>; |
||
1683 | jmachado | 61 | |
62 | |||
63 | /* |
||
64 | $scope.data = [ |
||
65 | { |
||
66 | "id" : 1, |
||
67 | "name" : "Nao deixa fazer drag", |
||
68 | "nodrag" : true, |
||
69 | "isDirectory" : true |
||
70 | |||
71 | }, |
||
72 | { |
||
73 | "id" : 2, |
||
74 | "name" : "Nao deixa fazer drop", |
||
75 | "nodrop" : true, |
||
76 | "isDirectory" : true |
||
77 | }, |
||
78 | { |
||
79 | "id" : 3, |
||
80 | "name" : "Deixa fazer Tudo", |
||
81 | "isDirectory" : true |
||
82 | }, |
||
83 | { |
||
84 | "id" : 4, |
||
85 | "name" : "Deixa fazer Tudo e ja foi movido", |
||
86 | "moved" : true, |
||
87 | "isDirectory" : true |
||
88 | }, |
||
89 | { |
||
90 | "id" : 5, |
||
91 | "name" : "Exemplo de folha nao deixa abrir", |
||
92 | "isDirectory" : false |
||
93 | } |
||
94 | ];*/ |
||
95 | $scope.treeOptions = { |
||
96 | accept: function(sourceNodeScope, destNodesScope, destIndex) { |
||
1690 | jmachado | 97 | |
98 | //if(destNodesScope) |
||
1692 | jmachado | 99 | //console.log(destNodesScope); |
100 | //console.log(sourceNodeScope); |
||
1690 | jmachado | 101 | //console.log(destIndex); |
102 | //console.log(destNodesScope.$parent.$modelValue.title); |
||
103 | //console.log(destNodesScope.$modelValue[0].type); |
||
104 | if(sourceNodeScope.$modelValue.type == destNodesScope.$modelValue[0].type) |
||
105 | return true; |
||
1683 | jmachado | 106 | return false; |
107 | }, |
||
108 | dropped: function(e) { |
||
109 | //console.log (e.source.nodeScope.$modelValue); |
||
110 | //alert ("Largado o nó com nome: " + e.source.nodeScope.$modelValue.name + " sobre " + e.dest.nodesScope.$parent.$modelValue.name); |
||
111 | } |
||
112 | }; |
||
113 | |||
114 | $scope.addRow = function(container) |
||
115 | { |
||
116 | if(!container.rows) |
||
117 | { |
||
118 | container.rows = []; |
||
119 | } |
||
120 | container.rows.push( |
||
121 | { |
||
122 | "showTitle" : true, |
||
123 | "showDescription" : false, |
||
124 | "type" : "row" |
||
125 | } |
||
126 | ); |
||
127 | } |
||
1690 | jmachado | 128 | $scope.removeRow = function(parent,index) |
129 | { |
||
130 | parent.rows.splice(index,1); |
||
131 | } |
||
132 | $scope.removeColumn = function(parent,index) |
||
133 | { |
||
134 | parent.columns.splice(index,1); |
||
135 | } |
||
136 | $scope.removeBlock = function(parent,index) |
||
137 | { |
||
138 | parent.blocks.splice(index,1); |
||
139 | } |
||
1683 | jmachado | 140 | $scope.addColumn = function(row) |
141 | { |
||
142 | if(!row.columns) |
||
143 | { |
||
144 | row.columns = []; |
||
145 | } |
||
146 | row.columns.push( |
||
147 | { |
||
148 | "showTitle" : true, |
||
149 | "showDescription" : false, |
||
150 | "cols" : 6, |
||
151 | "type" : "column" |
||
152 | } |
||
153 | ); |
||
154 | } |
||
155 | |||
1690 | jmachado | 156 | $scope.addBlock = function(column) |
157 | { |
||
158 | if(!column.blocks) |
||
159 | { |
||
160 | column.blocks = []; |
||
161 | } |
||
162 | column.blocks.push( |
||
163 | { |
||
164 | "showTitle" : true, |
||
165 | "showDescription" : false, |
||
166 | "cols" : 6, |
||
167 | "type" : "block" |
||
168 | } |
||
169 | ); |
||
170 | } |
||
171 | |||
1692 | jmachado | 172 | $scope.addCollectionId = function(block) |
173 | { |
||
174 | if(!block.collectionIds) |
||
175 | { |
||
176 | block.collectionIds = []; |
||
177 | } |
||
178 | var colId = block.choosedCol.id; |
||
179 | var found = block.collectionIds.filter(function(id){ return id === colId }); |
||
180 | if(found.length == 0) |
||
181 | { |
||
182 | block.collectionIds.push(colId); |
||
183 | } |
||
184 | } |
||
185 | $scope.removeCollectionId = function(block,$index) |
||
186 | { |
||
187 | block.collectionIds.splice($index,1); |
||
188 | } |
||
189 | |||
1683 | jmachado | 190 | $scope.getColStyle = function(column) |
191 | { |
||
192 | return "col-md-" + column.cols; |
||
193 | } |
||
1692 | jmachado | 194 | |
195 | $scope.getCollectionTreeName = function(cid) |
||
196 | { |
||
197 | var found = $scope.collections.filter(function(collection){ return collection.id === cid })[0]; |
||
198 | //console.log(found.treeName); |
||
1710 | jmachado | 199 | return found.pathName; |
1692 | jmachado | 200 | } |
201 | |||
202 | $scope.setMaxPublishDate = function ($event,block) { |
||
203 | |||
204 | var datetimepicker = $($event.target).parents(".form-group").find(".datetimepicker"); |
||
205 | $(datetimepicker).datetimepicker({locale: 'pt',format: 'YYYY/MM/DD'}) |
||
206 | .on("dp.change", function (data) { |
||
207 | //alert($("#"+datePicker).find("input").val()); |
||
208 | block.maxPublishDateStr = $(datetimepicker).find("input").val(); |
||
209 | $scope.$apply(); |
||
210 | |||
211 | }); |
||
212 | } |
||
213 | $scope.setMinPublishDate = function ($event,block) { |
||
214 | |||
215 | var datetimepicker = $($event.target).parents(".form-group").find(".datetimepicker"); |
||
216 | $(datetimepicker).datetimepicker({locale: 'pt',format: 'YYYY/MM/DD'}) |
||
217 | .on("dp.change", function (data) { |
||
218 | //alert($("#"+datePicker).find("input").val()); |
||
219 | block.minPublishDateStr = $(datetimepicker).find("input").val(); |
||
220 | $scope.$apply(); |
||
221 | |||
222 | }); |
||
223 | } |
||
224 | $scope.clearDateMax = function(block) |
||
225 | { |
||
226 | block.maxPublishDateStr = ""; |
||
227 | } |
||
228 | $scope.clearDateMin = function(block) |
||
229 | { |
||
230 | block.minPublishDateStr = ""; |
||
231 | } |
||
232 | |||
233 | //Meotodo necessário para incializar os pickers após serem criados |
||
234 | $scope.updateDatetimePickers = function() |
||
235 | { |
||
236 | $('.datetimepicker').datetimepicker({ |
||
237 | locale: 'pt', |
||
238 | format: 'YYYY/MM/DD' |
||
239 | }); |
||
240 | } |
||
241 | |||
242 | $scope.saveRepositoryInterfaceData = function() |
||
243 | { |
||
244 | widgetSimpleCallWithActionParameters( |
||
245 | "<%=request.getContextPath()%>/user/repositoryDoc.do", |
||
246 | "saveRepositoryInterfaceData", |
||
247 | { |
||
248 | "id" : <%=id%>, |
||
249 | "data" : JSON.stringify($scope.data) |
||
250 | }, |
||
251 | "#treeAppPageContent", |
||
252 | function() |
||
253 | { |
||
254 | modalWebMessagesGivenContainer("Dados salvos","#treeAppPageContent"); |
||
255 | }, |
||
256 | function() |
||
257 | { |
||
258 | modalWebMessagesGivenContainer("Ocorreram erros","#treeAppPageContent"); |
||
259 | } |
||
260 | ); |
||
261 | } |
||
1683 | jmachado | 262 | } |
263 | ); |
||
264 | |||
265 | </script> |
||
266 | |||
267 | |||
268 | |||
1692 | jmachado | 269 | <div class="panel panel-primary"> |
270 | <div class="panel-heading clearfix"> |
||
271 | Criação de Interface para o Repositório Digital |
||
272 | </div> |
||
273 | <div class="panel-body"> |
||
1683 | jmachado | 274 | |
1692 | jmachado | 275 | <div class="web-messages"></div> |
1683 | jmachado | 276 | |
277 | |||
1692 | jmachado | 278 | <div class="form-horizontal"> |
279 | <div class="form-group"> |
||
280 | <label class="col-md-1 control-label">ID</label> |
||
281 | <div class="col-md-11"> |
||
282 | <input disabled type="text" class="form-control" value="<%=id%>"/> |
||
283 | </div> |
||
1683 | jmachado | 284 | </div> |
1692 | jmachado | 285 | <div class="form-group"> |
1714 | jmachado | 286 | <label class="col-md-1 control-label">Margens Mínimas</label> |
287 | <div class="col-md-11"> |
||
288 | <select ng-class="{'bg-red': data.containerFluid == false, 'bg-green': data.containerFluid == true}" class="form-control chosenOff" type="text" ng-model="data.containerFluid" ng-options="o.v as o.n for o in [{ n: 'Sim', v: true }, { n: 'Não', v: false }]">> |
||
289 | |||
290 | </select> |
||
291 | </div> |
||
292 | </div> |
||
293 | <div class="form-group"> |
||
1692 | jmachado | 294 | <label class="col-md-1 control-label">Título</label> |
295 | <div class="col-md-9"> |
||
296 | <input type="text" class="form-control" ng-model="data.title"/> |
||
297 | </div> |
||
298 | <div class="col-md-2"> |
||
299 | <select ng-class="{'bg-red': data.showTitle == false, 'bg-green': data.showTitle == true}" class="form-control chosenOff" type="text" ng-model="data.showTitle" ng-options="o.v as o.n for o in [{ n: 'Mostrar', v: true }, { n: 'Não Mostrar', v: false }]">> |
||
1683 | jmachado | 300 | |
1692 | jmachado | 301 | </select> |
302 | </div> |
||
1683 | jmachado | 303 | </div> |
1692 | jmachado | 304 | <div class="form-group"> |
305 | <label class="col-md-1 control-label">Descrição</label> |
||
306 | <div class="col-md-9"> |
||
307 | <textarea rows="3" class="form-control" ng-model="data.description"> |
||
1683 | jmachado | 308 | |
1692 | jmachado | 309 | </textarea> |
310 | </div> |
||
311 | <div class="col-md-2" > |
||
312 | <select ng-class="{'bg-red': data.showDescription == false, 'bg-green': data.showDescription == true}" class="form-control chosenOff" type="text" ng-model="data.showDescription" ng-options="o.v as o.n for o in [{ n: 'Mostrar', v: true }, { n: 'Não Mostrar', v: false }]">> |
||
313 | |||
314 | </select> |
||
315 | </div> |
||
1683 | jmachado | 316 | </div> |
1692 | jmachado | 317 | <div class="panel panel-info"> |
318 | <div class="panel-heading"> |
||
319 | Linhas |
||
320 | <button ng-click="addRow(data)" class="btn btn-default pull-right"><span class="glyphicon glyphicon-plus"></span> Linha</button> |
||
1683 | jmachado | 321 | </div> |
1692 | jmachado | 322 | <div class="panel-body" ui-tree="treeOptions" id="page-content-root"> |
323 | <div style="padding: 10px" ui-tree-nodes ng-model="data.rows"> |
||
324 | <div ng-repeat="row in data.rows" ui-tree-node ng-include="'rows_renderer.html'" ng-init="parent=data"></div> |
||
325 | </div> |
||
326 | </div> |
||
1683 | jmachado | 327 | </div> |
328 | </div> |
||
329 | |||
330 | |||
331 | |||
1692 | jmachado | 332 | <%-- <pre class="code">{{ data | json }}</pre>--%> |
1683 | jmachado | 333 | |
1692 | jmachado | 334 | </div> |
335 | |||
336 | |||
1683 | jmachado | 337 | </div> |
338 | |||
1692 | jmachado | 339 | <div> |
340 | <button ng-click="saveRepositoryInterfaceData()" type="button" class="btn btn-success">Salvar</button> |
||
341 | <a class="btn btn-danger pullright" href="<%=request.getContextPath()%>/user/repositoryListInterfaces.do">Sair</a> |
||
342 | </div> |
||
1683 | jmachado | 343 | |
344 | </div> |
||
345 | </div> |
||
346 | |||
347 | |||
348 | |||
349 | <!--TEMPLATE RECURSIVO--> |
||
350 | <script type="text/ng-template" id="rows_renderer.html"> |
||
351 | <!--Para nao deixar fazer drag--> |
||
1690 | jmachado | 352 | <div class="row clearfix" ng-class="{modified: node.modified, nodrop: node.nodrop, nodrag: node.nodrag, moved: node.moved}"> |
1683 | jmachado | 353 | <div class="panel panel-primary"> |
1690 | jmachado | 354 | <div class="panel-heading"> |
355 | <i class="glyphicon glyphicon-resize-vertical" ui-tree-handle></i> Linha {{$index + 1}} |
||
356 | <button ng-click="removeRow(parent,$index)" class="btn btn-danger btn-xs pull-right"><span class="glyphicon glyphicon-remove"></span></button> |
||
357 | </div> |
||
1683 | jmachado | 358 | <div class="panel-body"> |
359 | |||
360 | <div class="form-group"> |
||
361 | <label class="col-md-1 control-label">Título</label> |
||
362 | <div class="col-md-9"> |
||
363 | <input type="text" class="form-control" ng-model="row.title"/> |
||
364 | </div> |
||
365 | <div class="col-md-2"> |
||
366 | <select ng-class="{'bg-red': row.showTitle == false, 'bg-green': row.showTitle == true}" class="form-control chosenOff" type="text" ng-model="row.showTitle" ng-options="o.v as o.n for o in [{ n: 'Mostrar', v: true }, { n: 'Não Mostrar', v: false }]">> |
||
367 | |||
368 | </select> |
||
369 | </div> |
||
370 | </div> |
||
371 | <div class="form-group"> |
||
372 | <label class="col-md-1 control-label">Descrição</label> |
||
373 | <div class="col-md-9"> |
||
374 | <textarea rows="3" class="form-control" ng-model="row.description"> |
||
375 | |||
376 | </textarea> |
||
377 | </div> |
||
378 | <div class="col-md-2"> |
||
379 | <select ng-class="{'bg-red': row.showDescription == false, 'bg-green': row.showDescription == true}" class="form-control chosenOff" type="text" ng-model="row.showDescription" ng-options="o.v as o.n for o in [{ n: 'Mostrar', v: true }, { n: 'Não Mostrar', v: false }]">> |
||
380 | |||
381 | </select> |
||
382 | </div> |
||
383 | </div> |
||
384 | |||
385 | <div class="col-md-12" style="padding: 10px"> |
||
386 | <div class="panel panel-info"> |
||
387 | <div class="panel-heading clearfix"> |
||
388 | Colunas |
||
389 | <button ng-click="addColumn(row)" class="btn btn-default pull-right"><span class="glyphicon glyphicon-plus"></span> Coluna</button> |
||
390 | </div> |
||
391 | <div class="panel-body"> |
||
392 | |||
393 | |||
1690 | jmachado | 394 | <div class="row" style="padding-left: 0" ui-tree-nodes="" ng-model="row.columns"> |
395 | <div style="padding: 10px" ng-class="getColStyle(column)" ng-repeat="column in row.columns" ui-tree-node ng-include="'columns_renderer.html'" ng-init="parent=row"> |
||
1683 | jmachado | 396 | |
397 | </div> |
||
398 | </div> |
||
399 | |||
400 | </div> |
||
401 | </div> |
||
402 | </div> |
||
403 | |||
404 | </div> |
||
405 | </div> |
||
406 | </div> |
||
407 | |||
408 | |||
409 | |||
410 | </script> |
||
411 | |||
412 | |||
413 | <!--TEMPLATE RECURSIVO--> |
||
414 | <script type="text/ng-template" id="columns_renderer.html"> |
||
415 | <!--Para nao deixar fazer drag--> |
||
416 | <div class="clearfix" ng-class="{modified: node.modified, nodrop: node.nodrop, nodrag: node.nodrag, moved: node.moved}"> |
||
417 | <div class="panel panel-primary"> |
||
418 | <div class="panel-heading clearfix"> |
||
419 | <i class="glyphicon glyphicon-resize-vertical" ui-tree-handle></i> |
||
420 | Coluna {{$index + 1}} |
||
1690 | jmachado | 421 | <select class=" chosenOff" |
1683 | jmachado | 422 | style="color:black" |
423 | ng-model="column.cols" |
||
424 | ng-options="o.v as o.n for o in [{ n: '1', v: 1 },{ n: '2', v: 2 },{ n: '3', v: 3 }, { n: '4', v: 4 }, { n: '5', v: 5 }, { n: '6', v: 6 }, { n: '7', v: 7 }, { n: '8', v: 8 }, { n: '9', v: 9 }, { n: '10', v: 10 }, { n: '11', v: 11 }, { n: '12', v: 12 }]"> |
||
425 | |||
426 | |||
427 | </select> |
||
1690 | jmachado | 428 | |
429 | <button ng-click="removeColumn(parent,$index)" class="btn btn-danger btn-xs pull-right"><span class="glyphicon glyphicon-remove"></span></button> |
||
430 | |||
1683 | jmachado | 431 | </div> |
432 | <div class="panel-body"> |
||
433 | |||
434 | <div class="form-group"> |
||
435 | <label class="col-md-3 control-label">Título</label> |
||
436 | <div class="col-md-7"> |
||
437 | <input type="text" class="form-control" ng-model="column.title"/> |
||
438 | </div> |
||
439 | <div class="col-md-2"> |
||
440 | <select ng-class="{'bg-red': column.showTitle == false, 'bg-green': column.showTitle == true}" class="form-control chosenOff" ng-model="column.showTitle" ng-options="o.v as o.n for o in [{ n: 'Mostrar', v: true }, { n: 'Não Mostrar', v: false }]"> |
||
441 | |||
442 | </select> |
||
443 | </div> |
||
444 | </div> |
||
445 | <div class="form-group"> |
||
446 | <label class="col-md-3 control-label">Descrição</label> |
||
447 | <div class="col-md-7"> |
||
448 | <textarea rows="3" class="form-control" ng-model="column.description"> |
||
449 | |||
450 | </textarea> |
||
451 | </div> |
||
452 | <div class="col-md-2"> |
||
453 | <select ng-class="{'bg-red': column.showDescription == false, 'bg-green': column.showDescription == true}" class="form-control chosenOff" ng-model="column.showDescription" ng-options="o.v as o.n for o in [{ n: 'Mostrar', v: true }, { n: 'Não Mostrar', v: false }]"> |
||
454 | |||
455 | </select> |
||
456 | </div> |
||
457 | </div> |
||
458 | |||
459 | |||
460 | <div class="col-md-12" style="padding: 10px"> |
||
461 | <div class="panel panel-info"> |
||
1690 | jmachado | 462 | <div class="panel-heading clearfix"> |
463 | Blocos |
||
464 | <button ng-click="addBlock(column)" class="btn btn-default pull-right"><span class="glyphicon glyphicon-plus"></span> Bloco</button> |
||
465 | </div> |
||
1683 | jmachado | 466 | <div class="panel-body"> |
467 | |||
468 | |||
1692 | jmachado | 469 | <div style="padding-left: 0" ui-tree-nodes="" ng-model="column.blocks"> |
1690 | jmachado | 470 | <div ng-repeat="block in column.blocks" ui-tree-node ng-include="'blocks_renderer.html'" ng-init="parent=column"> |
1683 | jmachado | 471 | </div> |
472 | </div> |
||
473 | |||
474 | </div> |
||
475 | </div> |
||
476 | </div> |
||
477 | |||
478 | </div> |
||
479 | </div> |
||
480 | </div> |
||
1690 | jmachado | 481 | </script> |
1683 | jmachado | 482 | |
483 | |||
1690 | jmachado | 484 | <!--TEMPLATE RECURSIVO--> |
485 | <script type="text/ng-template" id="blocks_renderer.html"> |
||
486 | <!--Para nao deixar fazer drag--> |
||
487 | <div class="clearfix" ng-class="{modified: node.modified, nodrop: node.nodrop, nodrag: node.nodrag, moved: node.moved}"> |
||
488 | <div class="panel panel-success"> |
||
489 | <div class="panel-heading clearfix"> |
||
490 | <i class="glyphicon glyphicon-resize-vertical" ui-tree-handle></i> |
||
491 | Bloco {{$index + 1}} |
||
1683 | jmachado | 492 | |
1690 | jmachado | 493 | <button ng-click="removeBlock(parent,$index)" class="btn btn-danger btn-xs pull-right"><span class="glyphicon glyphicon-remove"></span></button> |
1683 | jmachado | 494 | |
1690 | jmachado | 495 | </div> |
496 | <div class="panel-body"> |
||
497 | |||
498 | <div class="form-group"> |
||
499 | <label class="col-md-3 control-label">Título</label> |
||
500 | <div class="col-md-7"> |
||
501 | <input type="text" class="form-control" ng-model="block.title"/> |
||
502 | </div> |
||
503 | <div class="col-md-2"> |
||
504 | <select ng-class="{'bg-red': block.showTitle == false, 'bg-green': block.showTitle == true}" class="form-control chosenOff" ng-model="block.showTitle" ng-options="o.v as o.n for o in [{ n: 'Mostrar', v: true }, { n: 'Não Mostrar', v: false }]"> |
||
505 | |||
506 | </select> |
||
507 | </div> |
||
508 | </div> |
||
1692 | jmachado | 509 | |
1690 | jmachado | 510 | <div class="form-group"> |
511 | <label class="col-md-3 control-label">Descrição</label> |
||
512 | <div class="col-md-7"> |
||
513 | <textarea rows="3" class="form-control" ng-model="block.description"> |
||
514 | |||
515 | </textarea> |
||
516 | </div> |
||
517 | <div class="col-md-2"> |
||
518 | <select ng-class="{'bg-red': block.showDescription == false, 'bg-green': block.showDescription == true}" class="form-control chosenOff" ng-model="block.showDescription" ng-options="o.v as o.n for o in [{ n: 'Mostrar', v: true }, { n: 'Não Mostrar', v: false }]"> |
||
519 | |||
520 | </select> |
||
521 | </div> |
||
522 | </div> |
||
523 | |||
1692 | jmachado | 524 | <div class="well well-sm">Colecções</div> |
525 | |||
526 | <div class="form-group"> |
||
527 | <label class="col-md-3 control-label">Estrutura</label> |
||
528 | <div class="col-md-9"> |
||
529 | <select class="form-control chosenOff" ng-model="block.tree" ng-options="o.v as o.n for o in [{ n: 'Ramificar em Árvore', v: true }, { n: 'Lista Flat', v: false }]"> |
||
530 | |||
531 | </select> |
||
532 | </div> |
||
533 | </div> |
||
534 | |||
535 | <div class="form-group"> |
||
536 | <label class="col-md-3 control-label">Colecção</label> |
||
537 | <div class="col-md-7"> |
||
1710 | jmachado | 538 | <select place-holder="Escolha Colecção" ng-model="block.choosedCol" class="form-control chosenOff" ng-options="collection as collection.pathName for collection in collections track by collection.id" ng-model="selected"> |
1692 | jmachado | 539 | |
540 | </select> |
||
541 | </div> |
||
542 | <div class="col-md-2"> |
||
543 | <button ng-click="addCollectionId(block)" class="btn btn-success btn-xs"><span class="glyphicon glyphicon-plus"></span></button> |
||
544 | </div> |
||
545 | </div> |
||
546 | <div class="form-group"> |
||
547 | <label class="col-md-3 control-label">Escolhidas</label> |
||
548 | <div class="col-md-9"> |
||
549 | <div class="list-group"> |
||
550 | <div class="list-group-item" ng-repeat="cid in block.collectionIds"> |
||
551 | {{getCollectionTreeName(cid)}} |
||
552 | <button ng-click="removeCollectionId(block,$index)" class="btn btn-danger btn-xs pull-right"><span class="glyphicon glyphicon-remove"/></button> |
||
553 | </div> |
||
554 | </div> |
||
555 | </div> |
||
556 | </div> |
||
557 | |||
558 | |||
559 | |||
560 | |||
561 | |||
562 | <div class="well well-sm">Documentos</div> |
||
563 | |||
564 | <div class="form-group"> |
||
565 | <label class="col-md-3 control-label">Ordenar</label> |
||
566 | <div class="col-md-9"> |
||
567 | <select class="form-control chosenOff" ng-model="block.orderBy" ng-options="o.v as o.n for o in [{ n: 'Titulo', v: 'title' }, { n: 'Data Publicação Asc', v: 'publishDateAsc' } , { n: 'Data Publicação Desc', v: 'publishDateDesc' }, { n: 'Data Criação Asc', v: 'saveDateAsc' }, { n: 'Data Criação Desc', v: 'saveDateDesc' }, { n: 'Data Atualização Asc', v: 'updateDateAsc' }, { n: 'Data Atualização Desc', v: 'updateDateDesc' }]"> |
||
568 | |||
569 | </select> |
||
570 | </div> |
||
571 | </div> |
||
572 | |||
573 | <div class="form-group"> |
||
574 | <label class="col-md-3 control-label">Metadados</label> |
||
575 | <div class="col-md-9"> |
||
576 | <select ng-class="{'bg-red': block.showDocumentMetaData == false, 'bg-green': block.showDocumentMetaData == true}" class="form-control chosenOff" ng-model="block.showDocumentMetaData" ng-options="o.v as o.n for o in [{ n: 'Mostrar', v: true }, { n: 'Não Mostrar', v: false }]"> |
||
577 | |||
578 | </select> |
||
579 | </div> |
||
580 | </div> |
||
581 | |||
582 | <%-- <div class="form-group"> |
||
583 | <label class="control-label col-md-3">Data Publi. Máxima</label> |
||
584 | <div class="col-sm-7"> |
||
585 | <md-datepicker |
||
586 | ng-init="date = (block.maxPublishDate | toDate)" |
||
587 | ng-model="date" |
||
588 | ng-change="block.maxPublishDate = date.toISOString()" |
||
589 | ></md-datepicker> |
||
590 | </div> |
||
591 | </div>--%> |
||
592 | <div class="form-group"> |
||
593 | <label class="control-label col-md-3">Data Publi. Máxima</label> |
||
594 | <div class="col-sm-7"> |
||
595 | <div class='input-group date datetimepicker' ng-click="setMaxPublishDate($event,block)"> |
||
596 | <input ng-model="block.maxPublishDateStr" type="text" class="form-control" ng-init="updateDatetimePickers()"/> |
||
597 | <span class="input-group-addon"> |
||
598 | <span class="glyphicon glyphicon-calendar"></span> |
||
599 | </span> |
||
600 | </div> |
||
601 | </div> |
||
602 | <div class="col-sm-2"> |
||
603 | <button type="button" class="btn btn-danger" ng-click="clearDateMax(block)"><span class="glyphicon glyphicon-remove"></span></button> |
||
604 | </div> |
||
605 | </div> |
||
606 | <div class="form-group"> |
||
607 | <label class="control-label col-md-3">Data Publi. Mínima</label> |
||
608 | <div class="col-sm-7"> |
||
609 | <div class='input-group date datetimepicker' ng-click="setMinPublishDate($event,block)"> |
||
610 | <input ng-model="block.minPublishDateStr" type="text" class="form-control" ng-init="updateDatetimePickers()"/> |
||
611 | <span class="input-group-addon"> |
||
612 | <span class="glyphicon glyphicon-calendar"></span> |
||
613 | </span> |
||
614 | </div> |
||
615 | </div> |
||
616 | <div class="col-sm-2"> |
||
617 | <button type="button" class="btn btn-danger" ng-click="clearDateMin(block)"><span class="glyphicon glyphicon-remove"></span></button> |
||
618 | </div> |
||
619 | </div> |
||
620 | |||
621 | <div class="well well-sm">Ficheiros</div> |
||
622 | |||
623 | |||
624 | <div class="form-group"> |
||
625 | <label class="col-md-3 control-label">Titulos</label> |
||
626 | <div class="col-md-9"> |
||
627 | <select ng-class="{'bg-red': block.showFileTitle == false, 'bg-green': block.showFileTitle == true}" class="form-control chosenOff" ng-model="block.showFileTitle" ng-options="o.v as o.n for o in [{ n: 'Mostrar', v: true }, { n: 'Não Mostrar', v: false }]"> |
||
628 | |||
629 | </select> |
||
630 | </div> |
||
631 | </div> |
||
632 | <div class="form-group"> |
||
633 | <label class="col-md-3 control-label">Descrições</label> |
||
634 | <div class="col-md-9"> |
||
635 | <select ng-class="{'bg-red': block.showFileDescription == false, 'bg-green': block.showFileDescription == true}" class="form-control chosenOff" ng-model="block.showFileDescription" ng-options="o.v as o.n for o in [{ n: 'Mostrar', v: true }, { n: 'Não Mostrar', v: false }]"> |
||
636 | |||
637 | </select> |
||
638 | </div> |
||
639 | </div> |
||
640 | |||
641 | |||
1690 | jmachado | 642 | </div> |
643 | </div> |
||
644 | </div> |
||
1683 | jmachado | 645 | </script> |