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