Subversion Repositories bacoAlunos

Rev

Rev 1726 | Rev 1728 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1675 jmachado 1
<%@ page import="jomm.dao.impl.AbstractDao" %>
2
<%@ page import="pt.estgp.estgweb.domain.RepositoryDocumentCollection" %>
3
<%@ page import="pt.estgp.estgweb.domain.RepositoryDocumentCollectionImpl" %>
4
<%@ page import="pt.estgp.estgweb.domain.RepositoryDocumentImpl" %>
5
<%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %>
6
<%@ page import="java.util.List" %>
7
<%@ page import="pt.utl.ist.berserk.logic.serviceManager.IServiceManager" %>
8
<%@ page import="pt.utl.ist.berserk.logic.serviceManager.ServiceManager" %>
9
<%@ page import="org.json.JSONArray" %>
10
<%@ page import="pt.estgp.estgweb.web.utils.RequestUtils" %>
11
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
12
<%@ taglib prefix="bacoTags" tagdir="/WEB-INF/tags" %>
13
<%@ taglib prefix="logic" uri="/WEB-INF/tlds/struts-logic.tld" %>
14
<%@ taglib prefix="baco" uri="/WEB-INF/tlds/baco.tld" %>
15
 
16
<style>
17
    .btn {
18
        margin-right: 8px;
19
    }
20
 
21
    .tree-node,.angular-ui-tree-handle {
22
        background: #f8faff;
23
        border: 1px solid #dae2ea;
24
        color: #7c9eb2;
25
        padding: 10px 10px;
26
    }
27
 
28
    .ui-tree-node
29
    {
30
        padding: 10px;
31
    }
32
    .angular-ui-tree-handle:hover {
33
        color: #438eb9;
34
        background: #f4f6f7;
35
        border-color: #dce2e8;
36
    }
37
 
38
    .angular-ui-tree-placeholder {
39
        background: #f0f9ff;
40
        border: 2px dashed #bed2db;
41
        -webkit-box-sizing: border-box;
42
        -moz-box-sizing: border-box;
43
        box-sizing: border-box;
44
    }
45
 
46
    .nodeEmpty {
47
        height: 50px;
48
        margin:10px;
49
        margin-left: 30px;
50
        border: 1px dashed blue;
51
    }
52
 
53
    .group-title {
54
        background-color: #687074 !important;
55
        color: #FFF !important;
56
    }
57
 
58
 
59
    /* --- Tree --- */
60
    .tree-node {
61
        border: 1px solid #dae2ea;
62
        background: #f8faff;
63
        color: #7c9eb2;
64
    }
65
    .tree-node-document {
1679 jmachado 66
        border: 1px solid #000000;
67
        background: #ffffff;
68
        color: #000000;
1675 jmachado 69
    }
70
    .tree-node-file {
71
        border: 1px solid #e8ea99;
72
        background: #fffae7;
73
        color: #b2a418;
74
    }
75
 
76
    .tree-node-description {
77
        border: 1px dashed #7f7f7e;
78
        background: #e5e5e3;
79
        color: #0d0c01;
80
    }
81
 
82
    .nodrop {
83
        background-color: #f2dede;
84
    }
85
 
86
 
87
    .nodrag {
88
        background-color: #f2eec1;
89
    }
90
 
91
    .tree-node-content {
92
        margin: 10px;
93
    }
94
 
1727 jmachado 95
    .lateMoved
96
    {
97
        border: 2px solid #65ebff !important;
98
    }
1675 jmachado 99
    /*Estilo adicionado por mim para os movidos*/
100
    .moved
101
    {
102
        border: 2px solid blue !important;
103
    }
104
 
1727 jmachado 105
 
1675 jmachado 106
    .modified
107
    {
108
        border: 4px dashed orange !important;
109
    }
110
</style>
111
<div class="container-fluid">
112
 
113
<%
114
 
115
    IServiceManager sm = ServiceManager.getInstance();
116
    String[] names = new String[]{};
117
    Object[] args = new Object[]{null};
118
    JSONArray roots = (JSONArray) sm.execute(RequestUtils.getRequester(request, response), "OpenRepositoryCollection", args, names);
119
 
120
    AbstractDao.getCurrentSession().beginTransaction();
121
    String collectionsJson = roots.toString();
122
    request.setAttribute("collectionsJson", collectionsJson);
123
 
124
%>
125
 
126
 
127
 
128
 
129
<div id="treeAppPageContent" ng-app="treeAppPageContent" ng-controller="treeAppPageContentController">
130
 
131
 
132
<script>
133
ping();
134
var treeAppPageContent = angular.module('treeAppPageContent', ['ui.tree']);
135
GLOBAL_BacoAngularAppDependencies.push('treeAppPageContent');
136
 
137
<!-- estes codigos todos do remove e do toggle e etc's não mechi em nada limitei-me a copiar dos gajos-->
138
treeAppPageContent.controller('treeAppPageContentController',  function ($scope) {
139
 
1727 jmachado 140
            $scope.movedDocsIds = [];
141
            $scope.lateMovedDocsIds = [];
142
 
1675 jmachado 143
            $scope.data = ${collectionsJson};
144
 
1679 jmachado 145
            $scope.onlyVisibles = false;
146
 
1675 jmachado 147
            /*
148
             $scope.data = [
149
             {
150
             "id" : 1,
151
             "name" : "Nao deixa fazer drag",
152
             "nodrag" : true,
153
             "isDirectory" : true
154
 
155
             },
156
             {
157
             "id" : 2,
158
             "name" : "Nao deixa fazer drop",
159
             "nodrop" : true,
160
             "isDirectory" : true
161
             },
162
             {
163
             "id" : 3,
164
             "name" : "Deixa fazer Tudo",
165
             "isDirectory" : true
166
             },
167
             {
168
             "id" : 4,
169
             "name" : "Deixa fazer Tudo e ja foi movido",
170
             "moved" : true,
171
             "isDirectory" : true
172
             },
173
             {
174
             "id" : 5,
175
             "name" : "Exemplo de folha nao deixa abrir",
176
             "isDirectory" : false
177
             }
178
             ];*/
179
            $scope.treeOptions = {
180
                accept: function(sourceNodeScope, destNodesScope, destIndex) {
181
 
182
                    return true;
183
                },
184
                dropped: function(e) {
185
                    //console.log (e.source.nodeScope.$modelValue);
186
                    //alert ("Largado o nó com nome: " + e.source.nodeScope.$modelValue.name + " sobre " + e.dest.nodesScope.$parent.$modelValue.name);
187
                }
188
            };
189
 
190
            $scope.openedAndHasNotChilds = function(node)
191
            {
192
                if(node.childs == null)
193
                    return false;
194
                return node.childs.length == 0;
195
            }
196
 
1727 jmachado 197
            $scope.removeCollection = function (collection,parent)
1726 jmachado 198
            {
199
 
1727 jmachado 200
 
201
                widgetSimpleCallWithActionParameters(
202
                        "<%=request.getContextPath()%>/user/repositoryDoc.do",
203
                        "deleteCollection",
204
                        {
205
                            "collectionId" : collection.id
206
                        },
207
                        "#treeAppPageContent",
208
                        function()
209
                        {
210
                            if(parent)
211
                            {
212
                                var index = parent.childs.indexOf(collection);
213
                                parent.childs.splice(index, 1);
214
                            }
215
                            else
216
                            {
217
                                scope.remove();
218
                            }
219
                            $scope.$apply();
220
                        }
221
                );
222
 
223
            };
224
 
1726 jmachado 225
            $scope.changeDocumentCollection = function(collection)
226
            {
1727 jmachado 227
                var documentIdsToMove = [];
228
                angular.forEach($scope.checkedDocuments, function(documentContainer, key)
1726 jmachado 229
                {
1727 jmachado 230
                    documentIdsToMove.push(documentContainer.document.id);
1726 jmachado 231
                });
232
                widgetSimpleCallWithActionParameters(
233
                        "<%=request.getContextPath()%>/user/repositoryDoc.do",
234
                        "changeDocumentCollection",
235
                        {
1727 jmachado 236
                            "newCollectionId" : collection.id,
237
                            "documentIds" : JSON.stringify(documentIdsToMove)
1726 jmachado 238
                        },
239
                        "#treeAppPageContent",
240
                        function()
241
                        {
1727 jmachado 242
                            //Adicionar aos Movidos
243
                            $scope.movedDocsIds = [];
244
                            angular.forEach($scope.checkedDocuments, function(documentContainer, key)
1726 jmachado 245
                            {
1727 jmachado 246
                                console.log("pushing doc " + documentContainer.document.id);
247
                                $scope.movedDocsIds.push(documentContainer.document.id);
248
                                $scope.lateMovedDocsIds.push(documentContainer.document.id);
249
                            });
250
                            if(collection.open && collection.open==true)
251
                            {
252
                                //Adicionar A colecção Nova se estiver aberta
253
                                angular.forEach($scope.checkedDocuments, function(documentContainer, key)
254
                                {
255
                                    //ERRO QUANDO SE PUDHAM DOIS
256
                                    collection.documents.push(documentContainer.document);
257
                                    delete documentContainer.document.checked;
258
                                });
259
                            }
260
                            else
261
                            {
262
                                //Abrir se não estiver
263
                                $scope.openItem(collection);
264
                            }
265
                            //Remover da colecção original
266
                            angular.forEach($scope.checkedDocuments, function(documentContainer, key)
267
                            {
268
                                var index = documentContainer.collection.documents.indexOf(documentContainer.document);
269
                                documentContainer.collection.documents.splice(index, 1);
1726 jmachado 270
 
271
                            });
1727 jmachado 272
                            $scope.checkedDocuments = [];
1726 jmachado 273
                            $scope.$apply();
274
                        },
275
                        function()
276
                        {
277
                            alert("A operação falhou, verifique os erros");
278
                        }
279
                );
280
            }
1727 jmachado 281
            $scope.documentMoved = function(document)
282
            {
283
                var returnValue = false;
284
                angular.forEach($scope.movedDocsIds, function(docId, key)
285
                {
286
                    if(document.id == docId)
287
                        returnValue = true;
288
                });
289
                return returnValue;
290
            }
291
            $scope.lateDocumentMoved = function(document)
292
            {
293
                var returnValue = false;
294
                angular.forEach($scope.lateMovedDocsIds, function(docId, key)
295
                {
296
                    if(document.id == docId)
297
                        returnValue = true;
298
                });
299
                return returnValue;
300
            }
1726 jmachado 301
 
1727 jmachado 302
            $scope.removeCheckedDocuments = function(collection)
303
            {
304
                angular.forEach(collection.childs, function(collection, key) {
305
                    $scope.removeCheckedDocuments(collection);
306
                });
307
                angular.forEach(collection.documents, function(document, key)
308
                {
309
                    angular.forEach($scope.checkedDocuments, function(documentContainer, key)
310
                    {
311
                        if(documentContainer.document == document)
312
                        {
313
                            var index = $scope.checkedDocuments.indexOf(documentContainer);
314
                            $scope.checkedDocuments.splice(index, 1);
315
                        }
316
                    });
317
                });
318
            }
1726 jmachado 319
 
1727 jmachado 320
 
1675 jmachado 321
            $scope.openItem = function(item)
322
            {
323
                //apenas deixa abrir neste caso
324
                if(item.open && item.open==true)
325
                {
1726 jmachado 326
                    $scope.removeCheckedDocuments(item);
1675 jmachado 327
                    item.open=false;
1726 jmachado 328
 
1675 jmachado 329
                    delete item.childs;
330
                    delete item.documents;
331
                }
332
                else
333
                {
334
                    widgetCallWithActionParameters(
335
                            "<%=request.getContextPath()%>/user/repositoryDoc.do",
336
                            "openRepositoryCollection",
337
                            {
338
                                "id" : item.id
339
                            },
340
                            "#treeAppPageContent",
341
                            function(json)
342
                            {
343
                                item.childs = json.collections;
344
                                item.open = true;
345
                                $scope.$apply();
346
                            });
347
 
348
                    widgetCallWithActionParameters(
349
                            "<%=request.getContextPath()%>/user/repositoryDoc.do",
350
                            "openRepositoryCollectionDocuments",
351
                            {
352
                                "id" : item.id
353
                            },
354
                            "#treeAppPageContent",
355
                            function(json)
356
                            {
357
                                item.documents = json.documents;
358
                                item.open = true;
359
                                $scope.$apply();
360
                                $('#treeAppPageContent [data-toggle="tooltip"]').tooltip();
361
                            });
362
 
363
 
364
                }
365
            }
366
            $scope.openDocumentsItem = function(item)
367
            {
368
                var collapseElement = $("#repositoryFiles" + item.id);
369
                if(item.open && item.open==true)
370
                {
371
                    item.open=false;
372
                    collapseElement.collapse("hide");
373
                }
374
                else
375
                {
376
                    item.open=true;
377
                    collapseElement.collapse("show");
378
                }
379
            }
1726 jmachado 380
            $scope.checkedDocuments = [];
1727 jmachado 381
            $scope.checkDocument = function(document,collection)
1726 jmachado 382
            {
383
                if(document.checked)
384
                {
1727 jmachado 385
                    var docContainer =
386
                    {
387
                        "document" : document,
388
                        "collection" : collection
389
                    }
390
                    $scope.checkedDocuments.push(docContainer);
1726 jmachado 391
                }
392
                else
393
                {
1727 jmachado 394
                    angular.forEach($scope.checkedDocuments, function(documentContainer, key)
395
                    {
396
                        if(documentContainer.document == document)
397
                        {
398
                            var index = $scope.checkedDocuments.indexOf(documentContainer);
399
                            $scope.checkedDocuments.splice(index, 1);
400
                        }
401
                    });
1726 jmachado 402
                }
403
            }
1679 jmachado 404
 
405
 
1727 jmachado 406
 
407
 
1679 jmachado 408
            $scope.hideNode = function(node)
409
            {
410
                if(!node.visible && $scope.onlyVisibles)
411
                    return true;
412
                return false;
413
            }
414
 
415
            //COPIADAS DO ficheiro repositoryDocument.jsp
416
            $scope.setDocumentFileInvisible = function(docFile)
417
            {
418
                docFile.visible=false;
419
                docFile.repositoryFileProxy.repositoryFile.accessControl ="resource.access.privateDomain";
420
            }
421
            $scope.setDocumentFileVisible = function(docFile)
422
            {
423
                docFile.visible=true;
424
                alert("As permissões do ficheiro serão definidas como privadas, por favor escolha as permissões novas.");
425
                docFile.repositoryFileProxy.repositoryFile.accessControl ="resource.access.privateDomain";
426
            }
427
 
428
 
1675 jmachado 429
        }
430
);
431
 
432
</script>
433
 
434
<!--TEMPLATE RECURSIVO-->
435
<script type="text/ng-template" id="childs_renderer.html">
436
    <!--Para nao deixar fazer drag-->
1727 jmachado 437
    <div ng-init="collection = node" data-nodrag class="tree-node tree-node-content clearfix" ng-class="{modified: node.modified, nodrop: node.nodrop, nodrag: node.nodrag, bacoInvisible: !node.visible, hidden: hideNode(node)}">
1675 jmachado 438
 
439
            <a class="btn btn-xs" ng-class="{
440
                                            'btn-default': !node.open,
441
                                            'btn-success': node.open,
442
                                          }"
443
                data-nodrag ng-click="openItem(node)">
444
                            <span
445
                                    class="glyphicon"
446
                                    ng-class="{
447
 
448
                                            'glyphicon-chevron-right': !node.open,
449
                                            'glyphicon-chevron-down': node.open
450
 
451
                                          }">
452
                            </span>
453
            </a>
1679 jmachado 454
 
455
             <span style="margin-right: 5px" class="glyphicon "
456
                   ng-class="{
457
                                                'glyphicon-folder-close': !node.open,
458
                                                'glyphicon-folder-open': node.open,
459
                                              }"
460
                     ></span>
461
 
462
            <label data-toggle="tooltip" title="Esta colecção está oculta!"  ng-show="node.visible == false">
463
                <span class="glyphicon glyphicon-ban-circle"/>
464
            </label>
465
 
466
            {{node.name}}
467
 
1727 jmachado 468
            <button ng-click="changeDocumentCollection(node)" data-toggle="tooltip" title="Mover documentos para aqui" class="btn btn-xs btn-warning" ng-show="checkedDocuments.length"><span class="glyphicon glyphicon-arrow-left"></span></button>
1679 jmachado 469
 
1727 jmachado 470
            <button ng-click="removeCollection(node,parent)" data-toggle="tooltip" title="Remover Colecção" class="btn btn-xs btn-danger pull-right"><span class="glyphicon glyphicon-remove"></span></button>
471
 
1675 jmachado 472
    </div>
473
 
474
 
1679 jmachado 475
    <ol data-nodrag ui-tree-nodes="" data-nodrop-enabled="true" ng-model="node" ng-class="{hidden: collapsed }">
1727 jmachado 476
        <li ng-repeat="node in node.childs" ui-tree-node ng-include="'childs_renderer.html'" ng-init="parent = collection">
1675 jmachado 477
        </li>
478
        <li ng-repeat="node in node.documents" ui-tree-node ng-include="'documents_renderer.html'">
479
        </li>
480
    </ol>
481
 
1679 jmachado 482
 
1675 jmachado 483
</script>
484
 
485
<!--TEMPLATE RECURSIVO-->
486
<script type="text/ng-template" id="documents_renderer.html">
487
    <!--Para nao deixar fazer drag-->
1727 jmachado 488
    <div data-nodrag class="tree-node tree-node-document tree-node-content clearfix" ng-class="{modified: node.modified, nodrop: node.nodrop, nodrag: node.nodrag, moved: documentMoved(node),lateMoved: lateDocumentMoved(node), bacoInvisible: !node.visible, hidden: hideNode(node)}">
1675 jmachado 489
 
1727 jmachado 490
        <!--a var collection vem do template da colecção pai onde se fez ng-init="collection = node"-->
491
        <input type="checkbox" ng-click="checkDocument(node,collection)" ng-model="node.checked" style="font-size: 1.4em; margin-right: 10px">
1679 jmachado 492
        <a class="btn btn-xs" ng-class="{
493
                                        'btn-default': !node.open,
494
                                        'btn-success': node.open,
495
                                      }"
496
           data-nodrag data-toggle="collapse" ng-click="openDocumentsItem(node)">
497
                        <span
498
                                class="glyphicon"
499
                                ng-class="{
1675 jmachado 500
 
1727 jmachado 501
                                        'glyphicon-zoom-in': !node.open,
502
                                        'glyphicon-zoom-out': node.open
1675 jmachado 503
 
1679 jmachado 504
                                      }">
505
                        </span>
506
        </a>
1675 jmachado 507
 
1679 jmachado 508
        <label data-toggle="tooltip" title="Este documento está oculto!" ng-show="node.visible == false">
509
            <span class="glyphicon glyphicon-ban-circle"/>
510
        </label>
1675 jmachado 511
 
1679 jmachado 512
 
513
 
514
 
515
 
1727 jmachado 516
        <span class="glyphicon glyphicon-file"></span>  {{node.title}} {{node.id}}
1675 jmachado 517
 
518
        <baco:hasRole role="admin,all,repositoryDocs">
1703 jmachado 519
            <a target="_blank" class="pull-right btn btn-warning btn-xs" href="<%=request.getContextPath()%>/user/repositoryEditDocument.do?repositoryDocumentId={{node.id}}">
1675 jmachado 520
                <span class="glyphicon glyphicon-pencil"></span>
521
            </a>
522
        </baco:hasRole>
523
    </div>
524
    <div id="repositoryFiles{{node.id}}" class="collapse">
525
 
1679 jmachado 526
       <ol data-nodrag ui-tree-nodes="" data-nodrop-enabled="true" ng-model="node" ng-class="{hidden: collapsed }">
527
           <li >
528
               <div data-nodrag class="tree-node tree-node-description tree-node-content clearfix">
529
                   <div ng-if="node.description">
530
                       <div class="col-md-2" style="text-align: right">
531
                           <span class="glyphicon glyphicon-tag"></span>
532
                           <span class="label label-primary">Descrição:</span>
533
                       </div>
534
                       <div class="col-md-10" style="border: 1px dashed black">
535
                           {{node.description}}
536
                       </div>
537
                   </div>
1675 jmachado 538
 
1679 jmachado 539
                   <div ng-if="node.internalIdentifier">
540
                       <div class="col-md-2" style="text-align: right">
541
                           <span class="glyphicon glyphicon-tag"></span>
542
                           <span class="label label-primary">ID INTERNO:</span>
543
                       </div>
544
                       <div class="col-md-10" style="border: 1px dashed black">
545
                           {{node.internalIdentifier}}
546
                       </div>
547
                   </div>
1675 jmachado 548
 
1679 jmachado 549
                   <div ng-if="node.publishDateStr">
550
                       <div class="col-md-2" style="text-align: right">
551
                           <span class="glyphicon glyphicon-tag"></span>
552
                           <span class="label label-primary">Data de Publicação:</span>
553
                       </div>
554
                       <div class="col-md-10" style="border: 1px dashed black">
555
                           {{node.publishDateStr}}
556
                       </div>
557
                   </div>
1675 jmachado 558
 
1679 jmachado 559
                   <div ng-if="node.closeDateStr">
560
                       <div class="col-md-2" style="text-align: right">
561
                           <span class="glyphicon glyphicon-tag"></span>
562
                           <span class="label label-primary">Data de Fim:</span>
563
                       </div>
564
                       <div class="col-md-10" style="border: 1px dashed black">
565
                           {{node.closeDateStr}}
566
                       </div>
567
                   </div>
1675 jmachado 568
 
1679 jmachado 569
                   <div ng-if="node.authorsJson" ng-repeat="autor in node.authorsJson.persons">
570
                       <div class="col-md-2" style="text-align: right">
571
                           <span class="glyphicon glyphicon-tag"></span>
572
                           <span class="label label-primary">Autor:</span>
573
                       </div>
574
                       <div class="col-md-10" style="border: 1px dashed black">
575
                           {{autor.firstNames}} {{autor.lastName}}
576
                       </div>
577
                   </div>
578
                   <div ng-if="node.contributorsJson" ng-repeat="autor in node.contributorsJson.persons">
579
                       <div class="col-md-2" style="text-align: right">
580
                           <span class="glyphicon glyphicon-tag"></span>
581
                           <span class="label label-primary">Colaborador:</span>
582
                       </div>
583
                       <div class="col-md-10" style="border: 1px dashed black">
584
                           {{autor.firstNames}} {{autor.lastName}}
585
                       </div>
586
                   </div>
587
                   <div ng-if="node.publisher">
588
                       <div class="col-md-2" style="text-align: right">
589
                           <span class="glyphicon glyphicon-tag"></span>
590
                           <span class="label label-primary">Entidade Publicadora:</span>
591
                       </div>
592
                       <div class="col-md-10" style="border: 1px dashed black">
593
                           {{node.publisher}}
594
                       </div>
595
                   </div>
596
               </div>
597
           </li>
1675 jmachado 598
            <li ng-repeat="node in node.repositoryDocumentFiles" ui-tree-node ng-include="'files_renderer.html'">
599
            </li>
600
       </ol>
601
    </div>
602
 
603
</script>
604
 
605
 
606
 
607
<script type="text/ng-template" id="files_renderer.html">
608
    <!--Para nao deixar fazer drag-->
1679 jmachado 609
    <div data-nodrag class="tree-node tree-node-file tree-node-content clearfix" ng-class="{modified: node.modified, nodrop: node.nodrop, nodrag: node.nodrag, moved: node.moved, bacoInvisible: !node.visible, hidden: hideNode(node)}">
1675 jmachado 610
        <label data-toggle="tooltip" title="Este ficheiro está oculto!"  ng-show="node.visible == false">
611
            <span class="glyphicon glyphicon-ban-circle"/>
612
        </label>
613
 
1679 jmachado 614
        <div class="col-md-11">
615
            <div ng-if="node.title">
616
                <div class="col-md-2" style="text-align: right">
617
                    <span class="glyphicon glyphicon-tag"></span>
618
                    <span class="label label-primary">Titulo:</span>
619
                </div>
620
                <div class="col-md-10" style="border: 1px dashed black">
621
                    <i> {{node.title}} </i>
622
                </div>
623
            </div>
624
            <div ng-if="node.description">
625
                <div class="col-md-2" style="text-align: right">
626
                    <span class="glyphicon glyphicon-tag"></span>
627
                    <span class="label label-primary">Descrição:</span>
628
                </div>
629
                <div class="col-md-10" style="border: 1px dashed black">
630
                    <i>{{node.description}}</i>
631
                </div>
632
            </div>
633
            <div class="col-md-12" style="margin-top: 4px">
634
                <span class="glyphicon glyphicon-paperclip"></span>
635
                <bacoTags:repositoryFile btnXs="true" transactional="false" staticTag="true" repositoryStream="{{node.repositoryFileProxy.repositoryStream}}" showHistory="true"/>
636
                {{node.repositoryFileProxy.repositoryFile.lastVersion.name}}
637
                ({{node.repositoryFileProxy.repositoryFile.lastVersion.size / 1024 | number:0}} KB)
638
            </div>
639
        </div>
640
        <div class="col-md-1">
641
            <button data-toggle="tooltip" title="Ocultar ficheiro" ng-show="node.visible == true" class="btn btn-danger pull-right" type="button" ng-click="setDocumentFileInvisible(node)"><span class="glyphicon glyphicon-ban-circle"/></button>
642
            <button data-toggle="tooltip" title="Repor ficheiro" ng-show="node.visible == false" class="btn btn-default pull-right" type="button" ng-click="setDocumentFileVisible(node)"><span class="glyphicon glyphicon-ok-circle"/></button>
643
 
644
            <div ng-if="node.repositoryFileProxy.repositoryFile.accessControl == 'resource.access.publicDomain'">
645
                Público
646
            </div>
647
            <div ng-if="node.repositoryFileProxy.repositoryFile.accessControl == 'resource.access.privateDomain'">
648
                Privado
649
            </div>
650
            <div ng-if="node.repositoryFileProxy.repositoryFile.accessControl == 'resource.access.authenticatedDomain'">
651
                Interno
652
            </div>
653
 
654
 
655
        </div>
1675 jmachado 656
    </div>
657
</script>
658
 
1679 jmachado 659
 
660
 
1675 jmachado 661
<div class="panel panel-default">
662
    <div class="panel-heading clearfix">
663
        Administração de Coleções do Repositório de Documentos Digitais
1679 jmachado 664
 
665
        <baco:hasRole role="admin,all,repositoryDocs">
666
            <select class="chosenOff pull-right" type="text" ng-model="onlyVisibles" ng-options="o.v as o.n for o in [{ n: 'Ver Todos', v: false }, { n: 'Ocultar invisiveis', v: true }]">>
667
            </select>
668
        </baco:hasRole>
1675 jmachado 669
    </div>
670
    <div class="panel-body">
671
 
672
        <div class="web-messages"></div>
673
 
674
 
675
 
1680 jmachado 676
 
1675 jmachado 677
        <div class="row">
678
 
679
            <div class="col-sm-12 form-horizontal">
680
                <div ui-tree="treeOptions" id="page-content-root">
681
                    <ol ui-tree-nodes ng-model="data">
682
                        <li ng-repeat="node in data" ui-tree-node ng-include="'childs_renderer.html'"></li>
683
                    </ol>
684
                </div>
685
            </div>
686
 
687
        </div>
1726 jmachado 688
        <div class="col-sm-12">
689
             <pre class="code">{{ checkedDocuments | json }}</pre>
690
         </div>
1675 jmachado 691
    </div>
692
 
693
 
694
</div>
695
</div>
696
 
697
<%--AbstractDao.getCurrentSession().getTransaction().commit();--%>
698
 
699
</div>