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