Bug 22015: Move DataTables CSS to global include
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tags / list.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Tools &rsaquo; Tags &rsaquo; [% IF ( do_it ) %]Review &rsaquo; [% ELSE %]Review tags[% END %]</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 <style>
8 tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent; }</style>
9 </head>
10
11 <body id="tags_list" class="tools">
12 [% INCLUDE 'header.inc' %]
13 [% INCLUDE 'cat-search.inc' %]
14
15 <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; <a href="/cgi-bin/koha/tags/review.pl">Tags</a> &rsaquo; Results for tag <i>[% tag | html %]</i></div>
16
17 <div class="main container-fluid">
18     <div class="row">
19         <div class="col-sm-10 col-sm-push-2">
20             <main>
21
22 [% IF ( titles ) %]
23 <h3>Titles tagged with the term <i>[% tag | html %]</i></h3>
24 <table id="itemst">
25         <thead><tr>
26             <th>Title</th>
27             <th>Location</th>
28             <th>&nbsp;</th>
29         </tr></thead>
30
31         [% FOREACH title IN titles %]
32             <tr>
33             <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = title.biblionumber %][% title.title | html %][% FOREACH subtitl IN title.subtitle %] [% subtitl.subfield | html %][% END %]</a>
34             [% title.author | html %]
35             <p>[% IF ( title.publishercode ) %]- [% title.publishercode | html %]
36             [% IF ( title.place ) %] [% title.place | html %][% END %][% END %]
37             [% IF ( title.pages ) %] - [% title.pages | html %][% IF ( title.size ) %] [% title.size | html %]
38             [% END %]
39             [% END %]</p>
40             [% IF ( title.notes ) %]
41             <p>[% title.notes | html %]</p>[% END %]
42             [% IF ( title.TagLoop ) %]<p style="font-size:90%"><strong>Tagged with:</strong> [% FOREACH TagLoo IN title.TagLoop %]
43             <a href="/cgi-bin/koha/tags/list.pl?tag=[% TagLoo.term | uri %]">[% TagLoo.term | html %]</a> <span class="weight">([% TagLoo.weight_total | html %])</span>[% IF ( loop.last ) %][% ELSE %], [% END %]
44             [% END %]</p>
45             [% END %]
46             </td>
47             <td>[% IF ( title.items ) %]<ul style="font-size:80%">[% FOREACH item IN title.items %]
48                 <li>
49                     [% item.branchname | html %] [% item.location_description | html %]
50                     [% IF ( item.itemcallnumber ) %]
51                         ([% item.itemcallnumber | html %])
52                     [% END %]
53                 </li>
54                 [% END %]</ul>[% ELSE %]This record has no items.[% END %]
55              </td>
56              <td><form method="post" action="/cgi-bin/koha/tags/list.pl"><input type="hidden" name="op" value="del" /><input type="hidden" name="tag" value="[% tag | html %]" /><input type="hidden" name="tag_id" value="[% title.tag_id | html %]" /><button type="submit" class="delete btn btn-default btn-sm"><i class="fa fa-trash"></i> Remove tag</button></form></td>
57             </tr>
58         [% END %]
59     </table>
60 [% ELSE %]
61         <div class="dialog message">There are no titles tagged with the term <i>[% tag | html %]</i></div>
62 [% END %]
63 </form>
64
65             </main>
66         </div> <!-- /.col-sm-10.col-sm-push-2 -->
67
68         <div class="col-sm-2 col-sm-pull-10">
69             <aside>
70                 <ul>
71                     <li><a href="/cgi-bin/koha/tags/review.pl?approved=1">Approved tags</a></li>
72                     <li><a href="/cgi-bin/koha/tags/review.pl?approved=-1">Rejected tags</a></li>
73                     <li><a href="/cgi-bin/koha/tags/review.pl?approved=0">Pending tags</a></li>
74                     <li><a href="/cgi-bin/koha/tags/review.pl?approved=all">All tags</a></li>
75                 </ul>
76                 [% INCLUDE 'tools-menu.inc' %]
77             </aside>
78         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
79      </div> <!-- /.row -->
80
81 [% MACRO jsinclude BLOCK %]
82     [% INCLUDE 'datatables.inc' %]
83     <script>
84         $(document).ready(function() {
85             $(".delete").click(function (event) {
86                 $(this).parent().parent().parent().addClass("selected");
87                 var answer = confirm(_("Are you sure you want to remove the tag from this title?"));
88                     if (!answer){
89                         $("tr").removeClass("selected");
90                         event.preventDefault();
91                     }
92             });
93             $("#itemst").dataTable($.extend(true, {}, dataTablesDefaults, {
94                 "aoColumnDefs": [
95                     { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
96                 ],
97                 "aaSorting": [[ 0, "asc" ]],
98                 "sPaginationType": "four_button"
99             }));
100         });
101     </script>
102 [% END %]
103
104 [% INCLUDE 'intranet-bottom.inc' %]