Bug 16602 - Remove the use of "onclick" from several templates
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / patron_lists / lists.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Tools &rsaquo; Patron lists</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% INCLUDE 'greybox.inc' %]
5 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
6 [% INCLUDE 'datatables.inc' %]
7
8 <script type="text/javascript">
9 //<![CDATA[
10     $(document).ready(function() {
11         $('#patron-lists-table').dataTable($.extend(true, {}, dataTablesDefaults, {
12             "autoWidth": false,
13             "aoColumnDefs": [
14                 { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }
15             ],
16             "sPaginationType": "four_button"
17         } ));
18         $(".delete_patron").on("click", function(){
19             $(".dropdown").removeClass("open");
20             var list = $(this).data("list-name");
21             return confirmDelete( _("Are you sure you want to delete the list %s?").format(list) );
22         });
23         $(".print_cards").on("click",function(e){
24             e.preventDefault();
25             var patron_list_id = $(this).data("patron_list_id");
26             GB_showCenter(_("Print patron cards from list"), "/cgi-bin/koha/patroncards/print.pl?patronlist_id=" + patron_list_id, 400, 800);
27         });
28     });
29 //]]>
30 </script>
31
32 </head>
33
34 <body id="patlist_lists" class="pat patlist">
35 [% INCLUDE 'header.inc' %]
36 [% INCLUDE 'cat-search.inc' %]
37 <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>
38
39 <div id="doc3" class="yui-t2">
40    <div id="bd">
41     <div id="yui-main">
42         <div class="yui-b">
43
44         <div id="toolbar" class="btn-toolbar">
45             <div class="btn-group">
46                 <a class="btn btn-small" href="add-modify.pl"><i class="fa fa-plus"></i> New patron list</a>
47             </div>
48         </div>
49
50         <h1>Your patron lists</h1>
51
52         [% IF ( lists ) %]
53
54         <table id="patron-lists-table">
55             <thead>
56                 <tr>
57                     <th>Name</th>
58                     <th>Patrons in list</th>
59                     <th class="NoSort">&nbsp;</th>
60                 </tr>
61             </thead>
62
63             <tbody>
64                 [% FOREACH l IN lists %]
65                     <tr>
66                         <td>[% l.name %]</td>
67                         <td>[% l.patron_list_patrons_rs.count || 0 %]</td>
68                         <td>
69                             <div class="dropdown">
70                                 <a class="btn btn-mini dropdown-toggle" id="listactions[% l.patron_list_id %]" role="button" data-toggle="dropdown" href="#">
71                                    Actions <b class="caret"></b>
72                                 </a>
73                                 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="listactions[% l.patron_list_id %]">
74                                     <li><a href="/cgi-bin/koha/patron_lists/list.pl?patron_list_id=[% l.patron_list_id %]"><i class="fa fa-user"></i> Add patrons</a></li>
75                                     <li><a href="/cgi-bin/koha/patron_lists/add-modify.pl?patron_list_id=[% l.patron_list_id %]"><i class="fa fa-pencil"></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 %]" data-list-name="[% l.name %]"><i class="fa fa-trash"></i> Delete list</a></li>
77                                     [% IF ( l.patron_list_patrons_rs.count ) %]
78                                         <li class="divider"></li>
79                                         <li><a href="#" class="print_cards" data-patron_list_id="[% l.patron_list_id %]"><i class="fa fa-print"></i> Print patron cards</a></li>
80                                         [% IF CAN_user_tools_edit_patrons %]
81                                             <li>
82                                                 <a href="/cgi-bin/koha/tools/modborrowers.pl?patron_list_id=[% l.patron_list_id %]&op=show">
83                                                     <i class="fa fa-pencil"></i> Batch edit patrons
84                                                 </a>
85                                             </li>
86                                         [% END %]
87                                         [% IF CAN_user_tools_delete_anonymize_patrons %]
88                                             <li>
89                                                 <a href="/cgi-bin/koha/tools/cleanborrowers.pl?step=2&patron_list_id=[% l.patron_list_id %]&checkbox=borrower">
90                                                     <i class="fa fa-trash"></i> Batch delete patrons
91                                                 </a>
92                                             </li>
93                                         [% END %]
94                                     [% END %]
95                                 </ul>
96                             </div>
97                         </td>
98                     </tr>
99                 [% END %]
100             </tbody>
101         </table>
102         [% ELSE %]
103            <div class="dialog message">There are no patron lists.</div>
104         [% END %]
105
106             </div>
107         </div>
108         <div class="yui-b noprint">
109             [% INCLUDE 'tools-menu.inc' %]
110         </div>
111     </div>
112 [% INCLUDE 'intranet-bottom.inc' %]