Bug 21137: Standardize breadcrumbs for tags page
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-tags.tt
1 [% USE Koha %]
2 [% USE KohaDates %]
3
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Tags</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% BLOCK cssinclude %]
8     <style>
9         fieldset { padding : .3em;margin:.3em 0;}
10         #tagcloud    {background-color: #F3F3F3; text-align: justify;padding:7px;}
11         .tag a       {text-decoration: none;}
12         .tag a:hover {text-decoration: underline;}
13         .tag         {display: block; padding-left: 1em;}
14         .tagcount    {display: none;}
15         .cloudweight {display: none;}
16         .tagweight {
17             display: none;
18             position: relative;
19             bottom: 0.4em;
20             color: red;
21             font-size: 12px;
22         }
23     </style>
24 [% END %]
25 </head>
26 [% IF ( loggedinusername ) %][% INCLUDE 'bodytag.inc' bodyid='opac-usertags' bodyclass='scrollto' %][% ELSE %][% INCLUDE 'bodytag.inc' bodyid='opac-tags' bodyclass='scrollto' %][% END %]
27 [% INCLUDE 'masthead.inc' %]
28
29 <div class="main">
30     <ul class="breadcrumb">
31         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
32         [% IF ( loggedinusername ) %]
33             <li><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a> <span class="divider">&rsaquo;</span></li>
34         [% END %]
35         <li><a href="#">Tags</a></li>
36     </ul>
37
38     <div class="container-fluid">
39         <div class="row-fluid">
40             [% IF ( OpacNav||loggedinusername ) %]
41                 <div class="span2">
42                     <div id="navigation">
43                         [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
44                     </div>
45                 </div>
46                 <div class="span10">
47             [% ELSE %]
48                 <div class="span12">
49             [% END %]
50
51                     <div id="usertags" class="maincontent">
52                         [% IF ( ERRORS ) %]
53                             [% FOREACH ERROR IN ERRORS %]
54                                 <div class="alert">
55                                     There was a problem with this operation:
56                                     [% IF ( ERROR.tagsdisabled ) %]
57                                         Sorry, tags are not enabled on this system.
58                                     [% ELSIF ( ERROR.badparam ) %]
59                                         ERROR: illegal parameter [% ERROR.badparam %]
60                                     [% ELSIF ( ERROR.login ) %]
61                                         ERROR: You must log in to complete that action.
62                                     [% ELSIF ( ERROR.failed_delete ) %]
63                                         ERROR: You cannot delete the tag [% ERROR.failed_delete %].
64                                         <br />Note: you can only delete your own tags.
65                                     [% ELSIF ( ERROR.scrubbed ) %]
66                                         Note: your tag contained markup code that was removed.
67                                         <br />The tag was added as &quot;[% ERROR.scrubbed %]&quot;.
68                                     [% ELSIF ( ERROR.scrubbed_all_bad ) %]
69                                         Note: your tag was entirely markup code.  It was NOT added.
70                                         <br />Please try again with plain text.
71                                     [% ELSE %]Unrecognized error.
72                                     [% END %]
73                                 </div>
74                             [% END %]
75                         [% END # /IF ERRORS %]
76                         <h1>All Tags</h1>
77
78                         <form method="get" action="opac-tags.pl" class="form-inline">
79                             <fieldset>
80                                 <label>
81                                     [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
82                                         Tags to show from other users
83                                     [% ELSE %]
84                                         Tags to show
85                                     [% END %]:
86                                 </label>
87                                 <div class="input-append">
88                                     <input type="text" name="limit" style="text-align: right;" maxlength="4" size="4" value="[% limit or "100" %]" />
89                                     <input type="submit" value="OK" class="btn" />
90                                 </div>
91                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
92                                     [% UNLESS ( loggedinusername ) %]
93                                         <p>
94                                             [% IF Koha.Preference('casAuthentication') %]
95                                                 [%# CAS authentication is too complicated for modal window %]
96                                                 <a href="/cgi-bin/koha/opac-user.pl">Log in to see your own saved tags.</a>
97                                             [% ELSE %]
98                                                 <a class="loginModal-trigger" href="/cgi-bin/koha/opac-user.pl">Log in to see your own saved tags.</a>
99                                             [% END %]
100                                         </p>
101                                     [% END %]
102                                 [% END %]
103                             </fieldset>
104                         </form>
105
106                         [% IF ( TAGLOOP ) %]
107                             <div id="tagcloud">
108                                 [% FOREACH TAGLOO IN TAGLOOP %]
109                                     <span class="tag tagweight[% TAGLOO.stratum %]" id="tag[% loop.count %]" style="display:inline;">
110                                     <a href="/cgi-bin/koha/opac-search.pl?tag=[% TAGLOO.term |url %]&amp;q=[% TAGLOO.term |url %]">[% TAGLOO.term |html %]</a>
111                                     <span class="tagweight">[% TAGLOO.weight_total %]</span>
112                                     </span>
113                                 [% END %]
114                             </div>
115                         [% END # / TAGLOOP%]
116                         [% IF ( add_op ) %]
117                             [% IF ( added_count ) %]
118                                 <div class="dialog message">[% added_count %] [% IF ( added_count == 1 ) %]tag[% ELSE %]tags[% END %] successfully added.</div>
119                             [% END %]
120                             [% IF ( deleted_count ) %]
121                             <div class="dialog message">[% deleted_count %] [% IF ( deleted_count == 1 ) %]tag[% ELSE %]tags[% END %] successfully deleted.</div>
122                             [% END %]
123                         [% END # /add_op %]
124
125                         [% IF ( MY_TAGS ) %]
126                         <form id="deletetags" method="post" action="opac-tags.pl">
127                             <h2>Your tags</h2>
128                             <table id="mytagst" class="table table-bordered table-striped">
129                                 <thead><tr><th>&nbsp;</th><th>Term</th><th>Title</th><th>Date added</th></tr></thead>
130                                 <tbody>
131                                     [% FOREACH MY_TAG IN MY_TAGS %]
132                                         <tr>
133                                             <td>
134                                                 <input type="checkbox" name="del[% MY_TAG.tag_id %]" value="del[% MY_TAG.tag_id %]">
135                                             </td>
136                                             <td class="tagterm">
137                                                 <span class="tdlabel">Tag:</span>
138                                                 [% IF MY_TAG.approved == 1 %]
139                                                     <a href="/cgi-bin/koha/opac-search.pl?tag=[% MY_TAG.term |url %]&amp;q=[% MY_TAG.term |url %]">[% MY_TAG.term |html %]</a>
140                                                 [% ELSE %]
141                                                     [% MY_TAG.term |html %] (not approved)
142                                                 [% END %]
143                                             </td>
144                                             <td>
145                                                 [% IF ( MY_TAG.XSLTBloc ) %]
146                                                     [% MY_TAG.XSLTBloc %]
147                                                 [% ELSE %]
148                                                     <span class="tdlabel">Title:</span>
149                                                     <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% MY_TAG.biblionumber %]">
150                                                         [% MY_TAG.title |html %]
151                                                         [% IF ( MY_TAG.subtitle ) %]
152                                                             [% FOREACH subtitle IN MY_TAG.subtitle %]
153                                                                 [% subtitle.subfield |html %]
154                                                             [% END %]
155                                                         [% END %]
156                                                     </a>
157                                                     [% IF ( MY_TAG.author ) %]
158                                                         by [% MY_TAG.author %]
159                                                     [% END %]
160                                                 [% END # /IF MY_TAG.XSLTBloc %]
161                                             </td>
162                                             <td>
163                                                 <span title="[% MY_TAG.date_created %]">
164                                                     <span class="tdlabel">Date added:</span>
165                                                     [% MY_TAG.date_created | $KohaDates %]
166                                                 </span>
167                                             </td>
168                                         </tr>
169                                     [% END %]
170                                 </tbody>
171                             </table>
172                             <input type="submit" value="Delete selected tags" class="btn btn-danger btn-sm delete">
173                         </form>
174                         [% END # /MY_TAGS %]
175                     </div> <!-- / .usertags -->
176                 </div> <!-- / .span10/12 -->
177             </div> <!-- / .row-fluid -->
178         </div> <!-- / .container-fluid -->
179     </div> <!-- / .main -->
180
181 [% INCLUDE 'opac-bottom.inc' %]
182 [% BLOCK jsinclude %]
183 [% INCLUDE 'datatables.inc' %]
184 <script>
185 //<![CDATA[
186     function checkboxesChecked() {
187         if ($("#deletetags input:checkbox:checked").length > 0) {
188             return 1;
189         } else {
190             return 0;
191         }
192     }
193
194     $(document).ready(function(){
195         var MSG_DELETE_TAG = _("Are you sure you want to delete the selected tag(s)?");
196         $(".delete").on("click", function(e){
197             if ( checkboxesChecked() == 1 ) {
198                 return confirmDelete(MSG_DELETE_TAG);
199             } else {
200                 alert(_("Please select a tag to delete."));
201                 e.preventDefault();
202             }
203         });
204
205         $("#mytagst").dataTable($.extend(true, {}, dataTablesDefaults, {
206             "sorting": [[ 2, "asc" ]],
207             "columnDefs": [
208               { "targets": [ 0 ], "sortable": false, "searchable": false }
209             ],
210             "columns": [
211                 null,
212                 { "type": "anti-the" },
213                 { "type": "title-string" },
214                 null
215             ]
216         }));
217     });
218 //]]>
219 </script>
220 [% END %]