Bug 32910: (follow-up) Replace v4 icon names with v6
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / patron_lists / lists.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Patron lists &rsaquo; Tools &rsaquo; Koha</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% INCLUDE 'greybox.inc' %]
8 </head>
9
10 <body id="patlist_lists" class="pat patlist">
11 [% WRAPPER 'header.inc' %]
12     [% INCLUDE 'cat-search.inc' %]
13 [% END %]
14
15 [% WRAPPER 'sub-header.inc' %]
16     [% WRAPPER breadcrumbs %]
17         [% WRAPPER breadcrumb_item %]
18             <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
19         [% END %]
20         [% WRAPPER breadcrumb_item bc_active= 1 %]
21             <span>Patron lists</span>
22         [% END %]
23     [% END #/ WRAPPER breadcrumbs %]
24 [% END #/ WRAPPER sub-header.inc %]
25
26 <div class="main container-fluid">
27     <div class="row">
28         <div class="col-sm-10 col-sm-push-2">
29             <main>
30
31         <div id="toolbar" class="btn-toolbar">
32             <div class="btn-group">
33                 <a class="btn btn-default" href="add-modify.pl"><i class="fa fa-plus"></i> New patron list</a>
34             </div>
35         </div>
36
37         <h1>Your patron lists</h1>
38
39         [% IF ( lists ) %]
40
41         <div class="page-section">
42             <table id="patron-lists-table">
43                 <thead>
44                     <tr>
45                         <th>Name</th>
46                         <th>Patrons in list</th>
47                         <th>Shared</th>
48                         <th class="NoSort">&nbsp;</th>
49                     </tr>
50                 </thead>
51
52                 <tbody>
53                     [% FOREACH l IN lists %]
54                         [% SET shared_by_other = l.owner.id != logged_in_user.id %]
55                         <tr>
56                             <td><a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% l.patron_list_id | uri %]">[% l.name | html %]</a></td>
57                             <td>[% l.patron_list_patrons_rs.count || 0 | html %]</td>
58                             <td>
59                                 [% IF l.shared %]
60                                     [% IF shared_by_other %]
61                                         by <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% l.owner.id | uri %]">[% INCLUDE 'patron-title.inc' patron=l.owner %]</a>
62                                     [% ELSE %]
63                                         by you
64                                     [% END %]
65                                 [% END %]
66                             </td>
67                             <td>
68                                 <div class="btn-group dropup">
69                                     <a class="btn btn-default btn-xs dropdown-toggle" id="listactions[% l.patron_list_id | html %]" role="button" data-toggle="dropdown" href="#">
70                                     Actions <b class="caret"></b>
71                                     </a>
72                                     <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="listactions[% l.patron_list_id | html %]">
73                                         <li><a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% l.patron_list_id | uri %]"><i class="fa fa-user"></i> Add patrons</a></li>
74                                         [% UNLESS shared_by_other %]
75                                             <li><a href="/cgi-bin/koha/patron_lists/add-modify.pl?patron_list_id=[% l.patron_list_id | uri %]"><i class="fa fa-pencil-alt"></i> Edit list</a></li>
76                                             <li><a class="delete_patron" href="/cgi-bin/koha/patron_lists/delete.pl?patron_list_id=[% l.patron_list_id | html %]" data-list-name="[% l.name | html %]"><i class="fa fa-trash-can"></i> Delete list</a></li>
77                                         [% END %]
78                                         [% IF ( l.patron_list_patrons_rs.count ) %]
79                                             <li class="divider"></li>
80                                             <li>
81                                                 <a class="print_cards" href="/cgi-bin/koha/patroncards/print.pl?patronlist_id=[% l.patron_list_id | html %]" data-patron_list_id="[% l.patron_list_id | html %]"><i class="fa fa-print"></i> Print patron cards</a>
82                                             </li>
83                                             [% IF CAN_user_tools_edit_patrons %]
84                                                 <li>
85                                                     <a href="/cgi-bin/koha/tools/modborrowers.pl?patron_list_id=[% l.patron_list_id | uri %]&op=show">
86                                                         <i class="fa fa-pencil-alt"></i> Batch edit patrons
87                                                     </a>
88                                                 </li>
89                                             [% END %]
90                                             [% IF CAN_user_tools_delete_anonymize_patrons %]
91                                                 <li>
92                                                     <a href="/cgi-bin/koha/tools/cleanborrowers.pl?step=2&patron_list_id=[% l.patron_list_id | uri %]&checkbox=borrower">
93                                                         <i class="fa fa-trash-can"></i> Batch delete patrons
94                                                     </a>
95                                                 </li>
96                                             [% END %]
97                                         [% END %]
98                                     </ul>
99                                 </div>
100                             </td>
101                         </tr>
102                     [% END %]
103                 </tbody>
104             </table>
105         </div> <!-- /.page-section -->
106
107             <!-- Modal to print patron cards -->
108             <div class="modal" id="patronExportModal" tabindex="-1" role="dialog" aria-labelledby="patronExportModal_label" aria-hidden="true">
109                 <div class="modal-dialog">
110                 <div class="modal-content">
111                 <div class="modal-header">
112                     <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">&times;</button>
113                     <h3 id="patronExportModal_label">Print patron cards</h3>
114                 </div>
115                 <div class="modal-body">
116                     <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
117                 </div>
118                 </div>
119                 </div>
120             </div>
121
122         [% ELSE %]
123            <div class="dialog message">There are no patron lists.</div>
124         [% END %]
125
126             </main>
127         </div> <!-- /.col-sm-10.col-sm-push-2 -->
128
129         <div class="col-sm-2 col-sm-pull-10">
130             <aside>
131                 [% INCLUDE 'tools-menu.inc' %]
132             </aside>
133         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
134      </div> <!-- /.row -->
135
136 [% MACRO jsinclude BLOCK %]
137     [% Asset.js("js/tools-menu.js") | $raw %]
138     [% INCLUDE 'datatables.inc' %]
139
140     <script>
141         $(document).ready(function() {
142             var patronExportModal = $("#patronExportModal");
143             var patronExportModalBody = $("#patronExportModal .modal-body");
144
145             $('#patron-lists-table').dataTable($.extend(true, {}, dataTablesDefaults, {
146                 "autoWidth": false,
147                 "aoColumnDefs": [
148                     { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }
149                 ],
150                 "sPaginationType": "full"
151             } ));
152             $(".delete_patron").on("click", function(){
153                 $(".dropdown").removeClass("open");
154                 var list = $(this).data("list-name");
155                 return confirmDelete( _("Are you sure you want to delete the list %s?").format(list) );
156             });
157
158             $(".print_cards").on("click", function(e){
159                 e.preventDefault();
160                 var page = $(this).attr("href");
161                 patronExportModalBody.load(page + " #exportingf");
162                 patronExportModal.modal("show");
163             });
164
165             patronExportModal.on("hidden.bs.modal", function(){
166                 patronExportModalBody.html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
167             });
168
169             patronExportModal.on("submit", "#exportingf", function(e){
170                 e.preventDefault();
171                 modal_body = patronExportModalBody;
172                 modal_body.html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
173                 target_url = $(this).attr("action");
174                 params =  $( this ).serialize();
175                 $("#patronExportModal .modal-body").load( target_url + "?" + params + " #export_patron_list");
176             });
177
178             patronExportModal.on("click",".closebtn,.gb-close",function(e){
179                 e.preventDefault();
180                 patronExportModal.modal("hide");
181             });
182
183         });
184     </script>
185 [% END %]
186
187 [% INCLUDE 'intranet-bottom.inc' %]