Bug 26703: suggestion and tags folders
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tags / list.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE AuthorisedValues %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>[% IF ( do_it ) %]Review[% ELSE %]Review tags[% END %] &rsaquo; Tags &rsaquo; Tools &rsaquo; Koha</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 <style>
9 tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent; }</style>
10 </head>
11
12 <body id="tags_list" class="tools">
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'cat-search.inc' %]
15
16 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
17     <ol>
18         <li>
19             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
20         </li>
21         <li>
22             <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
23         </li>
24         <li>
25             <a href="/cgi-bin/koha/tags/review.pl">Tags</a>
26         </li>
27         <li>
28             <a href="#" aria-current="page">
29                 Results for tag <em>[% tag | html %]</em>
30             </a>
31         </li>
32     </ol>
33 </nav>
34
35 <div class="main container-fluid">
36     <div class="row">
37         <div class="col-sm-10 col-sm-push-2">
38             <main>
39
40 [% IF ( titles ) %]
41 <h3>Titles tagged with the term <em>[% tag | html %]</em></h3>
42 <table id="itemst">
43         <thead><tr>
44             <th>Title</th>
45             <th>Location</th>
46             <th>&nbsp;</th>
47         </tr></thead>
48
49         [% FOREACH title IN titles %]
50             <tr>
51             <td>[% INCLUDE 'biblio-title.inc' biblio=title link = 1 %]
52             [% title.author | html %]
53             <p>[% IF ( title.publishercode ) %]- [% title.publishercode | html %]
54             [% IF ( title.place ) %] [% title.place | html %][% END %][% END %]
55             [% IF ( title.pages ) %] - [% title.pages | html %][% IF ( title.size ) %] [% title.size | html %]
56             [% END %]
57             [% END %]</p>
58             [% IF ( title.notes ) %]
59             <p>[% title.notes | html %]</p>[% END %]
60             [% IF ( title.TagLoop ) %]<p style="font-size:90%"><strong>Tagged with:</strong> [% FOREACH TagLoo IN title.TagLoop %]
61             <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 %]
62             [% END %]</p>
63             [% END %]
64             </td>
65             <td>[% IF ( title.items ) %]<ul style="font-size:80%">[% FOREACH item IN title.items %]
66                 <li>
67                     [% item.branchname | html %]
68                     <span class="shelvingloc">
69                         [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]
70                     </span>
71                     [% IF ( item.itemcallnumber ) %]
72                         ([% item.itemcallnumber | html %])
73                     [% END %]
74                 </li>
75                 [% END %]</ul>[% ELSE %]This record has no items.[% END %]
76              </td>
77              <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>
78             </tr>
79         [% END %]
80     </table>
81 [% ELSE %]
82     <div class="dialog message">There are no titles tagged with the term <em>[% tag | html %]</em></div>
83 [% END %]
84 </form>
85
86             </main>
87         </div> <!-- /.col-sm-10.col-sm-push-2 -->
88
89         <div class="col-sm-2 col-sm-pull-10">
90             <aside>
91                 <ul>
92                     <li><a href="/cgi-bin/koha/tags/review.pl?approved=1">Approved tags</a></li>
93                     <li><a href="/cgi-bin/koha/tags/review.pl?approved=-1">Rejected tags</a></li>
94                     <li><a href="/cgi-bin/koha/tags/review.pl?approved=0">Pending tags</a></li>
95                     <li><a href="/cgi-bin/koha/tags/review.pl?approved=all">All tags</a></li>
96                 </ul>
97                 [% INCLUDE 'tools-menu.inc' %]
98             </aside>
99         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
100      </div> <!-- /.row -->
101
102 [% MACRO jsinclude BLOCK %]
103     [% INCLUDE 'datatables.inc' %]
104     <script>
105         $(document).ready(function() {
106             $(".delete").click(function (event) {
107                 $(this).parent().parent().parent().addClass("selected");
108                 var answer = confirm(_("Are you sure you want to remove the tag from this title?"));
109                     if (!answer){
110                         $("tr").removeClass("selected");
111                         event.preventDefault();
112                     }
113             });
114             $("#itemst").dataTable($.extend(true, {}, dataTablesDefaults, {
115                 "aoColumnDefs": [
116                     { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
117                 ],
118                 "aaSorting": [[ 0, "asc" ]],
119                 "sPaginationType": "full"
120             }));
121         });
122     </script>
123 [% END %]
124
125 [% INCLUDE 'intranet-bottom.inc' %]