list.html 6.54 KB
Newer Older
Prosper De Laure's avatar
Prosper De Laure committed
1
<div class="row" data-translate-catalog="archivesPubliques/messages" id="archiveList">
2
3
    <?merge hasReachMaxResults ?>
    <h4><span>Your query returns too much results, only first results are displayed.</span></h4>
Alexandre Morin's avatar
Alexandre Morin committed
4
    <input type="hidden" id="transaction" value="[?merge transaction ?]" />
Cyril Vazquez's avatar
Cyril Vazquez committed
5
    <input type="hidden" id="collection" value="[?merge collection.json() ?]" />
Prosper De Laure's avatar
Prosper De Laure committed
6
7
8
    <div class="panel panel-primary">
        <div class="panel-heading clearfix">
            <div class="pull-left">
9
10
11
12
                <?merge hasReachMaxResults.not() ?>
                <h4><?merge content.count() ?> result(s)</h4>
                <?merge hasReachMaxResults ?>
                <h4><?merge content.count() ?> result(s) on <?merge totalResultsWithoutLimit ?> archive(s)</h4>
Prosper De Laure's avatar
Prosper De Laure committed
13
14
            </div>
            <div class="dropdown pull-right" data-translate-catalog="recordsManagement/messages">
Cyril Vazquez's avatar
Cyril Vazquez committed
15
16
                <?merge isCollectionView.bool() ?>
                <button class="btn btn-warning" type="button" id="deleteCollections">Remove All Collections</button>
Prosper De Laure's avatar
Prosper De Laure committed
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
                <button class="btn btn-warning dropdown-toggle" type="button" id="archiveList_actions" data-toggle="dropdown" aria-expanded="true" title="Actions" disabled="disabled">
                    <i class="fa fa-navicon">&nbsp;</i>&nbsp;Actions
                    <span class="caret"></span>
                </button>
                <?hinclude recordsManagement/archive/resultListActionsButton.html ?>
                
            </div>
        </div>
        <div class="panel-body" style="padding: 0;">
            <table class="table dataTable" data-table-paginationtype="two_button" data-table-unsortablecolumns="6">
                <thead>
                    <tr>
                        <th><input type="checkbox" id="archiveList_selectAll"/></th>
                        <th>Intitul&eacute;</th>
                        <th>Producteur</th>
Alexandre Morin's avatar
Alexandre Morin committed
32
                        <th>Date de dépôt</th>
Prosper De Laure's avatar
Prosper De Laure committed
33
34
                        <th>Dates extr&ecirc;mes</th>
                        <th>Statut</th>
Cyril Vazquez's avatar
Cyril Vazquez committed
35
                        <th><span><i class="fa fa-star-half-full" title="Favoris"></i></span></th>
Prosper De Laure's avatar
Prosper De Laure committed
36
37
38
39
                        <th style="min-width:150px"></th>
                    </tr>
                </thead>
                <tbody>
cyril-vazquez's avatar
cyril-vazquez committed
40
                    <?merge content ?>
Prosper De Laure's avatar
Prosper De Laure committed
41
                    <div>
42
43
44
45
46
47
48
                        <tr
                            id="[?merge .archiveId ?]"
                            name="[?merge .archiveName ?]"
                            data-iscommunicable="[?merge .isCommunicable ?]"
                            class="[?merge .disposable.bool().then('danger') ?] [?merge .hasRights.bool().not().then('text-muted') ?]"
                            data-hasRights="[?merge .hasRights.bool().then('true', 'false') ?]"
                        >
Prosper De Laure's avatar
Prosper De Laure committed
49
                            <td>  <?merge .disposable @data-disposable ?>
Alexis Ragot's avatar
Alexis Ragot committed
50
                                <input type="checkbox" data-archive-status="[?merge .status ?]" data-restituable="[?merge .restituable ?]" data-final-disposition='[?merge .finalDisposition ?]' data-visible='[?merge .visible ?]' value="[?merge .archiveId ?]"/>
Prosper De Laure's avatar
Prosper De Laure committed
51
52
53
                            </td>
                            <td><?merge .archiveName ?></td>
                            <td><?merge .originator ?></td>
54
                            <td><span class="hidden"><?merge .depositDate.format('Y-m-d H:i:s') ?></span><?merge .depositDate.format('d-m-Y H:i:s') ?></td>
cyril-vazquez's avatar
cyril-vazquez committed
55
                            <td><span class="hidden"><?merge .startDate.format('Ymd') ?></span><?merge .startDate ?> &nbsp; <?merge .endDate ?></td>
Prosper De Laure's avatar
Prosper De Laure committed
56
                            <td class="archiveStatus"><?merge .statusDesc ?></td>
Cyril Vazquez's avatar
Cyril Vazquez committed
57
                            <td data-isInUserCollection="[?merge .isInUserCollection.bool().then('true', 'false') ?]"><i class="collection fa [?merge .isInUserCollection.bool().then('fa-star orange', 'fa-star-o') ?]"></i></td>
Prosper De Laure's avatar
Prosper De Laure committed
58
59
60
                            <td>
                                <div class="btn-group pull-right">
                                   
61
                                    <button type="button" class="btn btn-success btn-sm viewArchive [?merge .hasRights.bool().not().then('disabled') ?]" title="Info"><span class="fa fa-info-circle"></span></button>
Prosper De Laure's avatar
Prosper De Laure committed
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
                                    <?merge .statusModif.bool() ?>
                                    <button class="btn btn-warning btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" disabled>
                                        <i class="fa fa-edit">&nbsp;</i>&nbsp;
                                        <span class="caret"></span>
                                    </button>
                                    <?merge .statusModif.bool().not() ?>
                                    <button class="btn btn-warning btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                        <i class="fa fa-edit">&nbsp;</i>&nbsp;
                                        <span class="caret"></span>
                                    </button>
                                    <?hinclude recordsManagement/archive/resultActionsButton.html ?>
                                </div>
                            </td>
                        </tr>
                    </div>
                </tbody>
            </table>
        </div>
        <!-- MODALS -->
        <?hinclude recordsManagement/archive/archiveManagement.html ?>
    </div>
</div>

<script>
    /* MULTIPLE ARCHIVE SELECTION*/

    $("#archiveList_selectAll").on('click', function () {
        $('table.dataTable').find('input[type="checkbox"]').prop('checked', $(this).prop('checked'));
    });

    $(".paginate_button").on('click', '.paginate_button', function () {
        $("archiveList_actions").prop('disabled', true);
        $('#archiveList_table').find('input[type="checkbox"]').prop('checked', false);
    });

    $("table.dataTable").on('click', function() {
        if($('input[data-archive-status]:checked').length > 0) {
            $("#archiveList_actions").prop('disabled', false);
        } else {
            $("#archiveList_actions").prop('disabled', true);
        }
103
104
105
106
107
108
109
110
111
112
113
114
    });

    $('#archiveList_actions').on('click', function () {
        //use addToCollection because it includes all differents types
        var archivesSelected = ArchivesAction.getSelectedArchives('addToCollection');
        if (archivesSelected.hasNoRightsCount > 0) {
            $('#resultListHtmlAuthorizedMenu').hide();
        } else {
            $('#resultListHtmlAuthorizedMenu').show();
        }
    });
</script>