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