Bug 25166: Add "aria-hidden = true" to Font Awesome icons in the OPAC
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-shelves.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% SET PRIVATE = 1 %]
5 [% SET PUBLIC = 2 %]
6 [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && Koha.Preference('TagsShowOnList') ) %]
7 [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && Koha.Preference('TagsInputOnList') ) %]
8 [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
9 [% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
10
11 [% BLOCK delete_shelf %]
12     <form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="deleteshelf[% shelf.shelfnumber | html %]" class="form-inline">
13         <input type="hidden" name="op" value="delete" />
14         <input type="hidden" name="referer" value="list" />
15         <input type='hidden' name='category' value='[% category | html %]' />
16         <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
17         <button type="submit" class="btn btn-link remove deleteshelf" data-shelfnumber="[% shelf.shelfnumber | html %]" data-shelfname="[% shelf.shelfname | html %]" data-shared="[% shelf.is_shared | html %]" data-count="[% contents.count | html %]"><i class="fa fa-remove" aria-hidden="true"></i>
18             [% IF ( context == "list" ) %]
19                 Delete
20             [% ELSE %]
21                 Delete list
22             [% END %]
23         </button>
24     </form>
25 [% END %]
26
27 [% INCLUDE 'doc-head-open.inc' %]
28 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo;   [% IF op == 'view' %]Contents of [% shelf.shelfname | html %][% ELSE %]Your lists[% END %]</title>[% INCLUDE 'doc-head-close.inc' %]
29 [% BLOCK cssinclude %][% END %]
30 </head>
31 [% IF ( loggedinusername ) %][% INCLUDE 'bodytag.inc' bodyid='opac-userlists' bodyclass='scrollto' %][% ELSE %][% INCLUDE 'bodytag.inc' bodyid='opac-lists' bodyclass='scrollto' %][% END %]
32
33 [% BLOCK list_permissions %]
34     <li>
35         <label for="allow_changes_from">Allow changes to contents from: </label>
36         <select name="allow_changes_from" id="allow_changes_from" onchange="AdjustRemark()">
37
38             [% IF shelf.allow_change_from_owner %]<option value="0">Nobody</option>[% ELSE %]<option value="0" selected="selected">Nobody</option>[% END %]
39
40             [% IF shelf.allow_change_from_owner && (( !shelf.is_public && !shelf.is_shared ) || !shelf.allow_change_from_others ) %]
41                 <option value="1" selected="selected">Owner only</option>
42             [% ELSE %]
43                 <option value="1">Owner only</option>
44             [% END %]
45
46             [% IF shelf.allow_change_from_others %]<option value="2" selected="selected">Anyone seeing this list</option>[% ELSE %]<option value="2">Anyone seeing this list</option>[% END %]
47
48         </select>
49         &emsp; <span id="anyone_remark" style="display:none;color:red;">The Anyone permission has no actual effect while this list is strictly private.</span>
50     </li>
51 [% END %]
52
53 [% INCLUDE 'masthead.inc' %]
54 <div class="main">
55     <ul class="breadcrumb noprint">
56         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
57         [% IF ( loggedinusername ) %]
58             <li><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a> <span class="divider">&rsaquo;</span></li>
59         [% END %]
60
61         [% IF op != 'list' %]
62             <li><a href="/cgi-bin/koha/opac-shelves.pl">Lists</a></li>
63         [% ELSE %]
64             <li>Lists</li>
65         [% END %]
66
67         [% IF shelf and shelf.is_private %]
68             [% IF op == 'view' OR op == 'edit_form' %]
69                 <li><span class="divider">&rsaquo;</span> <a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=[% PRIVATE | uri %]">Your lists</a></li>
70             [% ELSE %]
71                 <li><span class="divider">&rsaquo;</span> Your lists</li>
72             [% END %]
73         [% ELSIF shelf AND shelf.is_public %]
74             [% IF op == 'view' %]
75                 <li><span class="divider">&rsaquo;</span> <a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=[% PUBLIC | uri %]">Public lists</a></li>
76             [% ELSE %]
77                 <li><span class="divider">&rsaquo;</span> Public lists</li>
78             [% END %]
79         [% END %]
80
81         [% IF op == 'view' %]
82             <li><span class="divider">&rsaquo;</span> Contents of <i>[% shelf.shelfname | html %]</i></li>
83         [% END %]
84
85         [% IF op == 'add_form' %]
86             <li><span class="divider">&rsaquo;</span> Create new list</li>
87         [% END %]
88
89         [% IF op == 'edit_form' %]
90             <li><span class="divider">&rsaquo;</span> Edit list <i>[% shelf.shelfname | html %]</i></li>
91         [% END %]
92
93     </ul> <!-- / .breadcrumb -->
94
95     <div class="container-fluid">
96         <div class="row-fluid">
97             [% IF ( OpacNav||loggedinusername ) && !print %]
98                 <div class="span2">
99                     <div id="navigation">
100                         [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
101                     </div>
102                 </div>
103             [% END %]
104
105             [% IF ( OpacNav||loggedinusername ) %]
106                 <div class="span10">
107             [% ELSE %]
108                 <div class="span12">
109             [% END %]
110                 <div id="usershelves" class="maincontent">
111
112                 [% FOR m IN messages %]
113                     [% SWITCH m.type %]
114                         [% CASE 'message' %]
115                             <div class="alert alert-success" role="alert">
116                         [% CASE 'error' %]
117                             <div class="alert alert-danger" role="alert">
118                     [% END %]
119                     [% SWITCH m.code %]
120                     [% CASE 'error_on_update' %]
121                         <span>An error occurred when updating this list.</span>
122                     [% CASE 'error_on_insert' %]
123                         <span>An error occurred when creating this list.</span>
124                     [% CASE 'error_on_delete' %]
125                         <span>An error occurred when deleting this list.</span>
126                     [% CASE 'error_on_add_biblio' %]
127                         <span>The item has not been added to the list. Please check it's not already in the list.</span>
128                     [% CASE 'error_on_remove_share' %]
129                         <span>The share has not been removed.</span>
130                     [% CASE 'success_on_update' %]
131                         <span>List updated.</span>
132                     [% CASE 'success_on_insert' %]
133                         <span>List created.</span>
134                     [% CASE 'success_on_delete' %]
135                         <span>List deleted.</span>
136                     [% CASE 'success_on_add_biblio' %]
137                         <span>The item has been added to the list.</span>
138                     [% CASE 'success_on_remove_biblios' %]
139                         <span>The item has been removed from the list.</span>
140                     [% CASE 'success_on_remove_share' %]
141                         <span>The share has been removed.</span>
142                     [% CASE 'does_not_exist' %]
143                         <span>This list does not exist.</span>
144                     [% CASE 'item_does_not_exist' %]
145                         <span>This item does not exist.</span>
146                     [% CASE 'unauthorized_on_view' %]
147                         <span>You do not have permission to view this list.</span>
148                     [% CASE 'unauthorized_on_insert' %]
149                         <span>You do not have permission to create a new list.</span>
150                     [% CASE 'unauthorized_on_update' %]
151                         <span>You do not have permission to update this list.</span>
152                     [% CASE 'unauthorized_on_delete' %]
153                         <span>You do not have permission to delete this list.</span>
154                     [% CASE 'unauthorized_on_add_biblio' %]
155                         <span>You do not have permission to add a record to this list.</span>
156                     [% CASE 'no_biblio_removed' %]
157                         <span>No record was removed.</span>
158                     [% CASE 'Koha::Exceptions::Virtualshelves::DuplicateObject' %]
159                         <span>An error occurred when creating the list. The name [% shelfname | html %] already exists.</span>
160                     [% CASE 'DBIx::Class::Exception' %]
161                         [% m.msg | html %]
162                     [% CASE %]
163                         [% m.code | html %]
164                         [% m.msg | html %]
165                     [% END %]
166                     </div>
167                 [% END %]
168
169                     [% IF shelf AND op == 'view' %]
170                         <h3>
171                             [% shelf.shelfname | html %]
172                             <a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-shelves.pl?rss=1&amp;op=view&amp;shelfnumber=[% shelf.shelfnumber | uri %]" class="rss-list-link noprint" aria-label="Subscribe to this list">
173                                 <i class="fa fa-fw fa-rss rsssearchicon" aria-hidden="true" title="Subscribe to this list"></i>
174                             </a>
175                         </h3>
176
177                          [% IF ( itemsloop ) %]
178                             [% SET contents = shelf.get_contents %]
179                             [% IF ( contents.count ) %]<p>This list contains [% contents.count | html %] titles</p>[% END %]
180                             <div id="floating">
181                              <div id="toolbar" class="toolbar clearfix">
182                                  <div class="list-actions">
183                                     <a class="btn btn-link newshelf" href="/cgi-bin/koha/opac-shelves.pl?op=add_form"><i class="fa fa-fw fa-plus" aria-hidden="true"></i> New list</a> <span class="sep">|</span>
184                                     <a href="/cgi-bin/koha/opac-downloadshelf.pl?shelfnumber=[% shelf.shelfnumber | uri %]" class="btn btn-link download" data-toggle="modal" data-target="#modalWin"><i class="fa fa-fw fa-download" aria-hidden="true"></i> Download list</a>
185
186                                     [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
187                                         <span class="sendlist"><a href="/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelf.shelfnumber | uri %]" class="btn btn-link send" onclick="open('/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelf.shelfnumber | html %]','win_form','scrollbars=yes,resizable=yes,height=400,width=500,top=50,left=100'); return false; "><i class="fa fa-fw fa-envelope" aria-hidden="true"></i> Send list</a></span>
188                                     [% END %]
189
190                                     <a class="btn btn-link print-small" target="_blank" href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% shelf.shelfnumber | html %]&sortfield=[% sortfield | html %]&direction=[% direction | uri %]&print=1"><i class="fa fa-fw fa-print" aria-hidden="true"></i> Print list</a>
191
192                                     [% IF can_manage_shelf %]
193                                         <span class="sep">|</span>
194                                         <form method="get" action="/cgi-bin/koha/opac-shelves.pl" class="form-inline">
195                                             <input type="hidden" name="op" value="edit_form" />
196                                             <input type="hidden" name="referer" value="view" />
197                                             <input type='hidden' name='category' value='[% shelf.category | html %]' />
198                                             <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
199                                             <button type="submit" class="btn btn-link editshelf"><i class="fa fa-fw fa-pencil-square-o" aria-hidden="true"></i> Edit list</button>
200                                         </form>
201
202                                         [% PROCESS delete_shelf context = "details" %]
203
204                                         [% IF category == PRIVATE && Koha.Preference('OpacAllowSharingPrivateLists') %]
205                                             <a href="/cgi-bin/koha/opac-shareshelf.pl?op=invite&shelfnumber=[% shelf.shelfnumber | uri %]" class="btn btn-link sharelist"><i class="fa fa-fw fa-share" aria-hidden="true"></i> Share list</a>
206                                         [% END %]
207                                     [% ELSIF category == PRIVATE # not manageshelf and private means shared %]
208                                         <form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="unshare[% shelf.shelfnumber | html %]" class="form-inline">
209                                             <input type="hidden" name="op" value="remove_share" />
210                                             <input type="hidden" name="referer" value="list" />
211                                             <input type='hidden' name='category' value='[% category | html %]' />
212                                             <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
213                                             <button type="submit" class="btn btn-link remove remove_share"
214                                                             data-shelfname="[% shelf.shelfname | html %]" data-shelfnumber="[% shelf.shelfnumber | html %]"><i class="fa fa-remove" aria-hidden="true"></i> Remove share</button>
215                                         </form>
216                                     [% END %]
217                                 </div>
218
219                                 <form action="/cgi-bin/koha/opac-shelves.pl" id="sorting-form" class="form-inline sort_by pull-right">
220                                     <input type="hidden" name="op" value="view" />
221                                     <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
222
223                                     <label for="sortfield">Sort by: </label>
224                                     <select name="sortfield" id="sortfield" class="resort">
225                                         <option value="">Default sorting</option>
226                                         <optgroup label="Author">
227                                             [% IF sortfield == 'author' && direction == 'asc' %]
228                                                 <option value="author:asc" selected="selected">Author (A-Z)</option>
229                                             [% ELSE %]
230                                                 <option value="author:asc">Author (A-Z)</option>
231                                             [% END %]
232                                             [% IF sortfield == 'author' && direction == 'desc' %]
233                                                 <option value="author:desc" selected="selected">Author (Z-A)</option>
234                                             [% ELSE %]
235                                                 <option value="author:desc">Author (Z-A)</option>
236                                             [% END %]
237                                         </optgroup>
238                                         <optgroup label="Title">
239                                             [% IF sortfield == 'title' && direction == 'asc' %]
240                                                 <option value="title:asc" selected="selected">Title (A-Z)</option>
241                                             [% ELSE %]
242                                                 <option value="title:asc">Title (A-Z)</option>
243                                             [% END %]
244                                             [% IF sortfield == 'title' && direction == 'desc' %]
245                                                 <option value="title:desc" selected="selected">Title (Z-A)</option>
246                                             [% ELSE %]
247                                                 <option value="title:desc">Title (Z-A)</option>
248                                             [% END %]
249                                         </optgroup>
250                                         <optgroup label="Call number">
251                                             [% IF sortfield == 'itemcallnumber' && direction == 'asc' %]
252                                                 <option value="itemcallnumber:asc" selected="selected">Call number (A-Z)</option>
253                                             [% ELSE %]
254                                                 <option value="itemcallnumber:asc">Call number (A-Z)</option>
255                                             [% END %]
256                                             [% IF sortfield == 'itemcallnumber' && direction == 'desc' %]
257                                                 <option value="itemcallnumber:desc" selected="selected">Call number (Z-A)</option>
258                                             [% ELSE %]
259                                                 <option value="itemcallnumber:desc">Call number (Z-A)</option>
260                                             [% END %]
261                                         </optgroup>
262                                         <optgroup label="Copyright date">
263                                             [% IF sortfield == 'copyrightdate' && direction == 'asc' %]
264                                                 <option value="copyrightdate:desc" selected="selected">Copyright date (newest to oldest)</option>
265                                             [% ELSE %]
266                                                 <option value="copyrightdate:desc">Copyright date (newest to oldest)</option>
267                                             [% END %]
268                                             [% IF sortfield == 'copyrightdate' && direction == 'desc' %]
269                                                 <option value="copyrightdate:asc" selected="selected">Copyright date (oldest to newest)</option>
270                                             [% ELSE %]
271                                                 <option value="copyrightdate:asc">Copyright date (oldest to newest)</option>
272                                             [% END %]
273                                         </optgroup>
274                                         <optgroup label="Date added">
275                                             [% IF sortfield == "dateadded" && direction == 'asc' %]
276                                                 <option value="dateadded:desc" selected="selected">Date added (newest to oldest)</option>
277                                             [% ELSE %]
278                                                 <option value="dateadded:desc">Date added (newest to oldest)</option>
279                                             [% END %]
280                                             [% IF sortfield == "dateadded" && direction == 'desc' %]
281                                                 <option value="dateadded:asc" selected="selected">Date added (oldest to newest)</option>
282                                             [% ELSE %]
283                                                 <option value="dateadded:asc">Date added (oldest to newest)</option>
284                                             [% END %]
285                                         </optgroup>
286                                     </select>
287
288                                     <input type="submit" class="btn btn-small" id="sort-submit" value="Resort list" />
289                                 </form>
290
291                             </div> <!-- / #toolbar -->
292
293                             <div id="selections-toolbar" class="toolbar noprint">
294                                 <span class="checkall"></span> <span class="clearall"></span> <span class="sep">|</span>
295                                 <span class="links">
296                                     <span id="selections">Select titles to: </span>
297                                     [% IF Koha.Preference( 'RequestOnOpac' ) == 1 %]
298                                         <span id="placehold"></span>
299                                     [% END %]
300                                     [% IF ( TagsInputEnabled && loggedinusername ) %]
301                                         <span id="addtags">
302                                           <a id="tagsel_tag" href="#" class="btn btn-link btn-disabled"><i class="fa fa-fw fa-tag" aria-hidden="true"></i> Tag</a>
303                                         </span>
304                                         <span id="tagsel_form" style="display:none">
305                                           <label for="tagsel_new">New tag(s), separated by a comma:</label>
306                                           <input type="text" name="tagsel_new" id="tagsel_new" maxlength="100" />
307                                           <input id="tagsel_button" name="tagsel_button" class="tagsel_button btn btn-small" title="tagsel_button" type="submit" value="Add" />
308                                           <a href="#" id="tagsel_cancel">Cancel</a>
309                                         </span>
310                                     [% END %]
311                                     [% IF loggedinusername && can_remove_biblios %]
312                                         <span id="removeitems"></span>
313                                     [% END %]
314                                 </span> <!-- / .links -->
315                             </div> <!-- / #selections-toolbar -->
316                             </div> <!-- /#floating -->
317
318                             <form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="myform" name="myform" class="checkboxed">
319                                 [% IF can_manage_shelf %]
320                                     <input type="hidden" name="op" value="remove_biblios" />
321                                     <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
322                                 [% END %]
323                                 <div class="searchresults">
324                                     <table id="listcontents" class="table">
325                                         <tbody>
326                                         [% FOREACH itemsloo IN itemsloop %]
327                                             <tr>
328                                                 <td class="select selectcol"><input type="checkbox" class="cb" name="biblionumber" value="[% itemsloo.biblionumber | html %]" /></td>
329                                                 [% UNLESS ( item_level_itypes ) %]
330                                                     <td>
331                                                         [% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %]
332                                                             <img src="[% itemsloo.imageurl | html %]" alt="[% itemsloo.description | html %]" title="[% itemsloo.description | html %]" />
333                                                         [% END %]
334                                                         [% itemsloo.description | html %]
335                                                     </td>
336                                                 [% END %]
337                                                 <td>
338                                                     <div class="coverimages">
339                                                         <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber | html %]">
340                                                             [% IF ( OPACLocalCoverImages ) %]
341                                                                 <span title="[% itemsloo.biblionumber |url %]" class="[% itemsloo.biblionumber | html %]" id="local-thumbnail[% loop.count | html %]"></span>
342                                                             [% END %]
343                                                             [% IF ( AdlibrisEnabled && itemsloo.normalized_isbn ) %]
344                                                                 <img src="[% AdlibrisURL | html %]?isbn=[% itemsloo.normalized_isbn | html %]" class="adlibris-cover" alt="Adlibris cover image" />
345                                                             [% END %]
346                                                             [% IF ( OPACAmazonCoverImages ) %]
347                                                                 [% IF ( itemsloo.normalized_isbn ) %]
348                                                                     <span title="[% itemsloo.biblionumber | html %]" id="amazon-thumbnail[% loop.count | html %]"><img src="https://images-na.ssl-images-amazon.com/images/P/[% itemsloo.normalized_isbn | html %].01.TZZZZZZZ.jpg" alt="" /></span>
349                                                                 [% ELSE %]
350                                                                     <span class="no-image">No cover image available</span>
351                                                                 [% END %]
352                                                             [% END %]
353
354                                                             [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
355                                                                 <span title="[% itemsloo.biblionumber | html %]" id="syndetics-thumbnail[% loop.count | html %]"><img src="https://secure.syndetics.com/index.aspx?isbn=[% itemsloo.normalized_isbn | html %]/SC.GIF&amp;client=[% SyndeticsClientCode | html %]&amp;type=xw10&amp;upc=[% itemsloo.normalized_upc | html %]&amp;oclc=[% itemsloo.normalized_oclc | html %]" alt="" /></span>
356                                                             [% END %]
357
358                                                             [% IF ( GoogleJackets ) %]
359                                                                 [% IF ( itemsloo.normalized_isbn ) %]
360                                                                     <div title="[% itemsloo.biblionumber |url %]" class="[% itemsloo.normalized_isbn | html %]" id="gbs-thumbnail[% loop.count | html %]"></div>
361                                                                 [% ELSE %]
362                                                                     <span class="no-image">No cover image available</span>
363                                                                 [% END %]
364                                                             [% END %]
365
366                                                             [% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %]
367                                                                 [% coce_id = itemsloo.normalized_ean || itemsloo.normalized_isbn %]
368                                                                 [% IF ( coce_id ) %]
369                                                                     <span title="[% itemsloo.biblionumber |url %]" class="[% coce_id | html %]" id="coce-thumbnail[% loop.count | html %]"></span>
370                                                                 [% ELSE %]
371                                                                     <span class="no-image">No cover image available</span>
372                                                                 [% END %]
373                                                             [% END %]
374
375
376                                                             [% IF OpenLibraryCovers %]
377                                                                 [% IF itemsloo.normalized_isbn %]
378                                                                     <span title="[% itemsloo.biblionumber | html %]" class="[% itemsloo.normalized_isbn | html %]" id="openlibrary-thumbnail[% loop.count | html %]"></span>
379                                                                 [% ELSE %]
380                                                                     <span class="no-image">No cover image available</span>
381                                                                 [% END %]
382                                                             [% END %]
383
384                                                         </a> <!-- / .p1 -->
385                                                         [% IF ( Koha.Preference('BakerTaylorEnabled') && !Koha.Preference('BakerTaylorBookstoreURL') ) %]
386                                                             [% bt_id = ( itemsloo.normalized_upc || itemsloo.normalized_isbn ) %]
387                                                             [% IF ( bt_id ) %]
388                                                                 <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" />
389                                                             [% ELSE %]
390                                                                 <span class="no-image">No cover image available</span>
391                                                             [% END %]
392                                                         [% END %]
393
394                                                         [% IF ( Koha.Preference('BakerTaylorEnabled') && Koha.Preference('BakerTaylorBookstoreURL') ) %]
395                                                             [% bt_id = ( itemsloo.normalized_upc || itemsloo.normalized_isbn ) %]
396                                                             [% IF ( bt_id ) %]
397                                                                 <a href="https://[% Koha.Preference('BakerTaylorBookstoreURL') | uri %][% bt_id | uri %]">
398                                                                     <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" />
399                                                                 </a>
400                                                             [% ELSE %]
401                                                                 <span class="no-image">No cover image available</span>
402                                                             [% END %]
403                                                         [% END %]
404
405                                                         [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %]
406                                                             [% IF ( itemsloo.BiblioDefaultViewmarc ) %]
407                                                                 <a class="custom_cover_image" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]">
408                                                             [% ELSE %]
409                                                                 [% IF ( itemsloo.BiblioDefaultViewisbd ) %]
410                                                                     <a class="custom_cover_image" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]">
411                                                                 [% ELSE %]
412                                                                     <a class="custom_cover_image" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber |url %]">
413                                                                 [% END %]
414                                                             [% END %]
415                                                             <img alt="Cover image" src="[% itemsloo.biblio_object.custom_cover_image_url | url %]" /></a>
416                                                         [% END %]
417
418                                                     </div>
419                                                     [% IF ( itemsloo.XSLTBloc ) %]
420                                                         [% itemsloo.XSLTBloc | $raw %]
421                                                     [% ELSE %]
422
423                                                         [% IF ( itemsloo.BiblioDefaultViewmarc ) %]
424                                                             <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
425                                                         [% ELSE %]
426                                                             [% IF ( itemsloo.BiblioDefaultViewisbd ) %]
427                                                                 <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
428                                                             [% ELSE %]
429                                                                 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
430                                                             [% END %]
431                                                         [% END %]
432
433                                                         [% INCLUDE 'biblio-title.inc' biblio=itemsloo %]
434                                                         </a>
435
436                                                         [% IF ( itemsloo.author ) %]
437                                                             by <a href="/cgi-bin/koha/opac-search.pl?q=au:[% itemsloo.author |url %]" title="Search for works by this author" class="author">[% itemsloo.author | html %]</a>
438                                                         [% ELSE %]
439                                                             &nbsp;
440                                                         [% END %]
441
442                                                         <span class="results_summary">
443                                                             <span class="label">Publication:</span>
444                                                             [% IF ( itemsloo.place ) %]
445                                                                 [% itemsloo.place | html %]
446                                                             [% END %]
447                                                             [% IF ( itemsloo.publishercode ) %]
448                                                                 [% itemsloo.publishercode | html %]
449                                                             [% END %]
450                                                             [% IF ( itemsloo.publicationyear ) %]
451                                                                 [% itemsloo.publicationyear | html %]
452                                                             [% ELSE %]
453                                                                 [% IF ( itemsloo.copyrightdate ) %]
454                                                                     [% itemsloo.copyrightdate | html %]
455                                                                 [% END %]
456                                                             [% END %]
457                                                             [% IF ( itemsloo.pages ) %]. [% itemsloo.pages | html %][% END %]
458                                                             [% IF ( itemsloo.notes ) %], [% itemsloo.notes | html %][% END %]
459                                                             [% IF ( itemsloo.item('size') ) %] [% itemsloo.item('size') | html %][% END %]
460                                                         </span>
461                                                         <span class="results_summary">
462                                                             <span class="label">Holdings:</span>
463                                                             [% IF ( itemsloo.ITEM_RESULTS ) %]
464                                                                 [% FOREACH ITEM_RESULT IN itemsloo.ITEM_RESULTS %]
465                                                                     [% ITEM_RESULT.homebranch | html %]
466                                                                     [% IF ( ITEM_RESULT.location_opac ) %]
467                                                                         <span class="shelvingloc">[% ITEM_RESULT.location_opac | html %]</span>
468                                                                     [% END %]
469                                                                     [% IF ( ITEM_RESULT.itemcallnumber ) %]
470                                                                         ([% ITEM_RESULT.itemcallnumber | html %])
471                                                                             [% IF ( loop.last ) %].[% ELSE %],[% END %]
472                                                                     [% END %]
473                                                                 [% END %]
474                                                             [% ELSE %]
475                                                                 This record has no items.
476                                                             [% END %]
477                                                         </span>
478                                                     [% END # / IF itemsloo.XSLTBloc %]
479
480                                                     [% IF ( TagsShowEnabled && itemsloo.TagLoop.size ) %]
481                                                         <div class="results_summary tags">
482                                                             <span class="label">Tags:</span>
483                                                             <ul>
484                                                                 [% FOREACH TagLoo IN itemsloo.TagLoop %]
485                                                                     <li><a href="/cgi-bin/koha/opac-search.pl?tag=[% TagLoo.term |url %]&amp;q=[% TagLoo.term |url %]">[% TagLoo.term | html %]</a> <span class="weight">([% TagLoo.weight_total | html %])</span></li>
486                                                                 [% END %]
487                                                             </ul>
488                                                         </div>
489                                                     [% END %]
490
491                                                     [% INCLUDE 'title-actions-menu.inc' items=itemsloo %]
492
493                                                     <!-- COinS / Openurl -->
494                                                     <span class="Z3988" title="[% itemsloo.coins | html %]"></span>
495                                                 </td>
496                                             </tr>
497                                         [% END # / FOREACH itemsloop %]
498                                         </tbody>
499                                     </table> <!-- / #listcontents -->
500                                 </div><!-- / .searchresults -->
501
502                             [% IF ( pagination_bar ) %]
503                                 <div class="pages">[% pagination_bar | $raw %]</div>
504                             [% END %]
505
506                         [% ELSE %]
507                             <div id="toolbar" class="toolbar clearfix">
508                                 <div class="list-actions">
509                                     <a class="btn btn-link newshelf" href="/cgi-bin/koha/opac-shelves.pl?op=add_form"><i class="fa fa-fw fa-plus" aria-hidden="true"></i> New list</a>
510                                     [% IF can_manage_shelf %]
511                                         <span class="sep">|</span>
512                                         <form method="get" action="/cgi-bin/koha/opac-shelves.pl" class="form-inline">
513                                             <input type="hidden" name="op" value="edit_form" />
514                                             <input type="hidden" name="referer" value="view" />
515                                             <input type="hidden" name="category" value="[% shelf.category | html %]" />
516                                             <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
517                                             <button type="submit" class="btn btn-link editshelf"><i class="fa fa-fw fa-pencil-square-o" aria-hidden="true"></i> Edit list</button>
518                                         </form>
519
520                                         [% PROCESS delete_shelf context = "details" %]
521
522                                     [% END %]
523                                 </div> <!-- / .list-actions -->
524                             </div> <!-- / #toolbar -->
525
526                             <div class="alert alert-info">
527                                 This list is empty.
528                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
529                                     You can add to your lists from the results of any <a href="opac-main.pl">search</a>.
530                                 [% END %]
531                             </div>
532                         [% END # / IF itemsloop %]
533                       [% END %]
534                     [% IF itemsloop && can_remove_biblios %]
535                         <input type="hidden" name="op" value="remove_biblios" />
536                         <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
537                         <input type="hidden" name="modifyshelfcontents" value="1" />
538                         <input type="submit" value="Remove selected items" id="remove-selected" class="btn btn-danger"/>
539                     [% ELSIF !itemsloop && can_manage_shelf %]
540                         <form method="post" action="opac-shelves.pl">
541                         <input type="hidden" name="op" value="delete" />
542                         <input type="hidden" name="referer" value="list" />
543                         <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]"/>
544                         <input type="submit" class="btn btn-danger" value="Delete this list" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST)" />
545                     [% END %]
546                             </form> <!-- / myform -->
547
548                     [% IF op == 'add_form' OR op == 'edit_form' %]
549                         <form method="post" action="/cgi-bin/koha/opac-shelves.pl">
550                             <fieldset class="rows">
551                                 [% IF op == 'add_form' %]
552                                     <div id="addshelf">
553                                     <legend>Create a new list</legend>
554                                     <input type="hidden" name="op" value="add" />
555                                 [% ELSE %]
556                                     <legend>Editing <em>[% shelf.shelfname | html %]</em></legend>
557                                     <input type="hidden" name="op" value="edit" />
558                                     <input type="hidden" name="referer" value="[% referer | html %]" />
559                                     <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
560                                 [% END %]
561                                 <input type="hidden" name="owner" id="owner" value="[% loggedinusernumber | html %]" />
562                                 <ol>
563                                     <li>
564                                         <label class="required" for="shelfname">List name: </label>
565                                         <input type="text" id="shelfname" name="shelfname" maxlength="255" value="[% shelf.shelfname | html %]" required="required" class="required"/> <span class="required">Required</span></li>
566                                     <li>
567                                         <label for="sortfield" >Sort this list by: </label>
568                                         <select name="sortfield" id="sortfield">
569                                             [% IF shelf.sortfield == "title" %]
570                                                 <option value="title" selected="selected">Title</option>
571                                             [% ELSE %]
572                                                 <option value="title">Title</option>
573                                             [% END %]
574                                             [% IF shelf.sortfield == "author" %]
575                                                 <option value="author" selected="selected">Author</option>
576                                             [% ELSE %]
577                                                 <option value="author">Author</option>
578                                             [% END %]
579                                             [% IF shelf.sortfield == "copyrightdate" %]
580                                                 <option value="copyrightdate" selected="selected">Year</option>
581                                             [% ELSE %]
582                                                 <option value="copyrightdate">Year</option>
583                                             [% END %]
584                                             [% IF shelf.sortfield == "itemcallnumber" %]
585                                                 <option value="itemcallnumber" selected="selected">Call number</option>
586                                             [% ELSE %]
587                                                 <option value="itemcallnumber">Call number</option>
588                                             [% END %]
589                                             [% IF shelf.sortfield == "dateadded" %]
590                                                 <option value="dateadded" selected="selected">Date added</option>
591                                             [% ELSE %]
592                                                 <option value="dateadded">Date added</option>
593                                             [% END %]
594                                         </select>
595                                     </li>
596                                     [% IF Koha.Preference('OpacAllowPublicListCreation') OR category == PUBLIC %]
597                                         <li>
598                                             <label for="category">Category:</label>
599                                             <select name="category" id="category" onchange="AdjustRemark()">
600                                                 [% IF shelf.is_private %]
601                                                         <option value="1" selected="selected">Private</option>
602                                                     [% ELSE %]
603                                                         <option value="1">Private</option>
604                                                     [% END %]
605                                                 [% IF shelf.is_public %]
606                                                     <option value="2" selected="selected">Public</option>
607                                                 [% ELSE %]
608                                                     <option value="2">Public</option>
609                                                 [% END %]
610                                             </select>
611                                             [% IF shelf.is_public AND NOT Koha.Preference('OpacAllowPublicListCreation') %]
612                                                 <span class="hint alert alert-info">The library has disabled the ability for patrons to create new public lists.  If you make your list private, you will not be able to make it public again.</span>
613                                             [% END %]
614                                         </li>
615                                     [% END %]
616                                     [% INCLUDE list_permissions %]
617                                 </ol>
618                                 [% UNLESS Koha.Preference('OpacAllowPublicListCreation') OR category == PUBLIC %]
619                                     <input type="hidden" name="category" value="[% PRIVATE | html %]" />
620                                 [% END %]
621                             </fieldset>
622
623                             <fieldset class="action">
624                                 <input type="submit" value="Save" class="btn" />
625                                 [% IF referer == 'view' %]
626                                     <a href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% shelf.shelfnumber | uri %]" class="cancel">Cancel</a>
627                                 [% ELSE %]
628                                      <a href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=[% PRIVATE | uri %]" class="cancel">Cancel</a>
629                                  [% END %]
630
631                             </fieldset>
632                         </form>
633
634                     [% ELSIF op == 'list' %]
635                         <h2>Lists</h2>
636                         <div class="toptabs ui-tabs ui-widget ui-widget-content ui-corner-all">
637                         <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
638                             [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
639                                 [% IF category == PRIVATE %]
640                                     <li id="privateshelves_tab" class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=listamp;category=[% PRIVATE | html %]">Your lists</a></li>
641                                 [% ELSE %]
642                                     <li id="privateshelves_tab" class="ui-state-default ui-corner-top"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=[% PRIVATE | html %]">Your lists</a></li>
643                                 [% END %]
644                             [% END %]
645                             [% IF category == PUBLIC %]
646                                 <li id="publicshelves_tab" class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=[% PUBLIC | html %]">Public lists</a></li>
647                             [% ELSE %]
648                                 <li id="publicshelves_tab" class="ui-state-default ui-corner-top"><a class="ui-tabs-anchor" href="/cgi-bin/koha/opac-shelves.pl?op=list&amp;category=[% PUBLIC | html %]">Public lists</a></li>
649                             [% END %]
650                         </ul>
651
652                         [% IF category == PRIVATE %]
653                             <div id="privateshelves" class="ui-tabs-panel ui-widget-content ui-corner-bottom" style="display:block;">
654                         [% ELSE %]
655                             <div id="publicshelves" class="ui-tabs-panel ui-widget-content ui-corner-bottom" style="display:block;">
656                         [% END %]
657
658                             [% IF loggedinusername %]
659                                 <div id="toolbar" class="toolbar"><a class="btn btn-link newshelf" href="/cgi-bin/koha/opac-shelves.pl?op=add_form"><i class="fa fa-plus" aria-hidden="true"></i> New list</a></div>
660                             [% ELSE %]
661                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
662                                     <div class="alert alert-info"><a href="/cgi-bin/koha/opac-shelves.pl?op=add_form">Log in to create a new list</a></div>
663                                 [% END %]
664                             [% END %]
665
666                             [% IF shelves.count %]
667                                 <table class="table">
668                                     <thead>
669                                         <tr>
670                                             <th>List name</th>
671                                             <th>Contents</th>
672                                             <th>Type</th>
673                                             <th>&nbsp;</th>
674                                         </tr>
675                                     </thead>
676                                     <tbody>
677                                         [% FOREACH s IN shelves %]
678                                             [% SET contents = s.get_contents %]
679                                             <tr>
680                                                 <td><a href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber | uri %]">[% s.shelfname | html %]</a></td>
681                                                 <td>[% IF contents.count %][% contents.count | html %] [% IF contents.count == 1 %]item[% ELSE %]items[% END %][% ELSE %]Empty[% END %]</td>
682                                                 <td>
683                                                     [% IF s.is_private %]
684                                                         [% IF s.is_shared %]Shared[% ELSE %]Private[% END %]
685                                                     [% ELSE %]
686                                                         Public
687                                                     [% END %]
688                                                 </td>
689                                                 <td>
690                                                     [% IF s.can_be_managed( loggedinusernumber ) %]
691                                                         <form action="/cgi-bin/koha/opac-shelves.pl" method="get" class="form-inline">
692                                                             <input type="hidden" name="shelfnumber" value="[% s.shelfnumber | html %]" />
693                                                             <input type="hidden" name="category" value="[% s.category | html %]" />
694                                                             <input type="hidden" name="op" value="edit_form" />
695                                                             <input type="hidden" name="referer" value="list" />
696                                                             <button type="submit" class="btn btn-link editshelf"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> Edit</button>
697                                                         </form>
698                                                     [% END %]
699                                                     [% IF s.can_be_deleted( loggedinusernumber ) %]
700                                                         [% PROCESS delete_shelf shelf = s context = "list" %]
701                                                     [% END %]
702                                                     [% IF s.is_private AND s.can_be_managed( loggedinusernumber ) AND Koha.Preference('OpacAllowSharingPrivateLists') %]
703                                                         <a href="/cgi-bin/koha/opac-shareshelf.pl?op=invite&shelfnumber=[% s.shelfnumber | uri %]" class="sharelist btn btn-link"><i class="fa fa-share" aria-hidden="true"></i> Share</a>
704                                                     [% END %]
705                                                     [% IF s.is_shared_with( loggedinusernumber ) %]
706                                                         <form action="opac-shelves.pl" method="post" id="unshare[% s.shelfnumber | html %]" class="form-inline">
707                                                             <input type="hidden" name="op" value="remove_share" />
708                                                             <input type="hidden" name="referer" value="list" />
709                                                             <input type='hidden' name='category' value='[% category | html %]' />
710                                                             <input type="hidden" name="shelfnumber" value="[% s.shelfnumber | html %]" />
711                                                             <button type="submit" class="btn btn-link remove remove_share"
712                                                             data-shelfname="[% s.shelfname | html %]" data-shelfnumber="[% s.shelfnumber | html %]"><i class="fa fa-remove" aria-hidden="true"></i> Remove share</button>
713                                                         </form>
714                                                     [% END %]&nbsp;
715                                                 </td>
716                                             </tr>
717                                         [% END %]
718                                     </tbody>
719                                 </table>
720                                 <div class="pages">[% pagination_bar | $raw %]</div>
721                             [% ELSE %]
722                                 [% IF category == PUBLIC %]
723                                     <p>No public lists.</p>
724                                 [% ELSIF loggedinusernumber %]
725                                     <p>No private lists.</p>
726                                 [% END %]
727                             [% END %]
728                             </div> [%# privateshelves or publicshelves %]
729                             </div> [%# <div class="toptabs ui-tabs ui-widget ui-widget-content ui-corner-all"> %]
730                         [% ELSIF NOT loggedinusernumber %]
731                             [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
732                                 <div class="alert alert-info"><a href="/cgi-bin/koha/opac-shelves.pl?op=add_form">Log in to create a new list</a></div>
733                             [% END %]
734                         [% END  # IF loggedinusername %]
735                 </div> <!-- / #usershelves -->
736                 </div> <!-- / .span10/12 -->
737       </div> <!-- / .row-fluid -->
738     </div> <!-- / .container-fluid -->
739   </div> <!-- / .main -->
740
741 <div class="modal hide" id="modalWin" role="dialog" aria-hidden="true" tabindex="-1">
742     <div class="modal-content">
743         <div class="modal-body">
744             <div style="margin:1em;padding:1em;font-size:150%;">
745                 <img src="[% interface | html %]/[% theme | html %]/images/loading.gif" alt="" /> Loading
746             </div>
747         </div>
748     </div>
749 </div>
750
751 <!-- DEBUG -->
752     <div id="debug"></div>
753 <!-- /DEBUG -->
754
755 [% INCLUDE 'opac-bottom.inc' %]
756 [% BLOCK jsinclude %]
757 [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
758 [% Asset.js("lib/hc-sticky.js") | $raw %]
759 <script>
760 var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?");
761 var MSG_REMOVE_ONE_FROM_LIST = _("Are you sure you want to remove this item from the list?");
762 var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to delete this list?");
763 var MSG_CONFIRM_REMOVE_SHARE = _("Are you sure you want to remove this share?");
764
765 [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'RequestOnOpac' ) == 1 ) ) %]
766     function holdSelections() {
767         var checkedBoxes = $("input:checkbox:checked");
768         if ($(checkedBoxes).size() == 0) {
769             alert(MSG_NO_RECORD_SELECTED);
770         } else {
771             var bibs = "";
772             $(checkedBoxes).each(function(){
773                 bibs += $(this).val() + "/";
774             });
775             document.location = "/cgi-bin/koha/opac-reserve.pl?biblionumbers="+bibs;
776         }
777     }
778 [% END %]
779 [% IF ( TagsInputEnabled && loggedinusername ) %]
780     function tagSelected() {
781         var checkedBoxes = $("input:checkbox:checked");
782         if ($(checkedBoxes).size()) {
783             $("#tagsel_tag").hide();
784             $(".tag_hides").hide();
785             $("#tagsel_form").show();
786         } else {
787             alert(MSG_NO_RECORD_SELECTED);
788         }
789     }
790
791     function tagCanceled() {
792         $("#tagsel_form").hide();
793         $("#tagsel_tag").show();
794         $(".tag_hides").show();
795         $("#tagsel_new").val("");
796         $(".tagstatus").empty().hide();
797     }
798
799     function tagAdded() {
800         var checkedBoxes = $("input:checkbox:checked");
801         if (!$(checkedBoxes).size()) {
802             alert(MSG_NO_RECORD_SELECTED);
803             return false;
804         }
805
806         var tag = $("#tagsel_new").val();
807         if (!tag || (tag == "")) {
808             alert(MSG_NO_TAG_SPECIFIED);
809             return false;
810         }
811
812         var bibs = [];
813         for (var i = 0; i < $(checkedBoxes).size(); i++) {
814             var box = $(checkedBoxes).get(i);
815             bibs[i] = $(box).val();
816         }
817
818         KOHA.Tags.add_multitags_button(bibs, tag);
819         return false;
820     }
821 [% END %]
822
823 function enableCheckboxActions(){
824     // Enable/disable controls if checkboxes are checked
825     var checkedBoxes = $(".checkboxed input:checkbox:checked");
826     if ($(checkedBoxes).size()) {
827       $("#selections").html(_("With selected titles: "));
828       $("#selections-toolbar .links a").removeClass("disabled");
829     } else {
830       $("#selections").html(_("Select titles to: "));
831       $("#selections-toolbar .links a").addClass("disabled");
832     }
833 }
834
835 $(function() {
836     [% IF Koha.Preference( 'opacbookbag' ) == 1 %]$(".addtocart,.cartRemove").removeClass("hidden");[% END %]
837     $("span.clearall").html("<a id=\"CheckNone\" href=\"#\">"+_("Clear all")+"<\/a>");
838     $("span.checkall").html("<a id=\"CheckAll\" href=\"#\">"+_("Select all")+"<\/a>");
839     $("a.print").show();
840
841     [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'RequestOnOpac' ) == 1 ) ) %]
842         $("#placehold").html("<a href=\"#\" class=\"btn btn-link hold tag_hides btn-disabled\"><i class=\"fa fa-fw fa-bookmark\" aria-hidden=\"true\"></i> "+_("Place hold")+"<\/a>");
843         $("#selections-toolbar a.hold").click(function(){
844             holdSelections();
845             return false;
846         });
847     [% END %]
848
849     // If JS is enabled add parameter to download link
850     var dialoglink = $(".download").attr("href");
851     dialoglink += "&context=modal";
852     $(".download").attr("href",dialoglink);
853
854     $("#CheckAll").click(function(){
855         $(".checkboxed").checkCheckboxes();
856         enableCheckboxActions();
857         return false;
858     });
859     $("#CheckNone").click(function(){
860         $(".checkboxed").unCheckCheckboxes();
861         enableCheckboxActions();
862         return false;
863     });
864
865     $(".cb").click(function(){
866       enableCheckboxActions();
867     });
868     enableCheckboxActions();
869
870     [% IF ( TagsInputEnabled && loggedinusername ) %]
871         var tagAdd = $(".tag_add");
872         tagAdd.removeClass("hidden");
873         $("#tagsel_tag").click(function(){
874             tagSelected();
875             return false;
876         });
877         $("#tagsel_cancel").click(function(){
878             tagCanceled();
879             return false;
880         });
881         $("#tagsel_button").click(function(){
882             tagAdded();
883             return false;
884         });
885
886         tagAdd.click(function(){
887             var thisid = $(this).attr("id");
888             thisid = thisid.replace("tag_add","");
889             $(this).hide();
890             $("#tagform"+thisid).show();
891             $("#newtag"+thisid).focus();
892             $("#newtag"+thisid+"_status").empty().hide();
893             return false;
894         });
895         $(".cancel_tag_add").click(function(){
896             var thisid = $(this).attr("id");
897             thisid = thisid.replace("cancel","");
898             $("#tagform"+thisid).hide();
899             $("#tag_add"+thisid).show();
900             $("#newtag"+thisid).val("");
901             $("#newtag"+thisid+"_status").empty().hide();
902             return false;
903         });
904         $(".tagbutton").click(function(){
905           var thisid = $(this).attr("title");
906           var tag = $("#newtag"+thisid).val();
907           if (!tag || (tag == "")) {
908               alert(MSG_NO_TAG_SPECIFIED);
909               return false;
910           }
911           KOHA.Tags.add_tag_button(thisid, tag);
912           return false;
913         });
914     [% END %]
915
916     [% IF loggedinusername && can_remove_biblios %]
917         $(".removefromlist").on("click", function(e){
918             return confirmDelete(MSG_REMOVE_ONE_FROM_LIST);
919         });
920
921         $("#myform").submit(function(){
922             var checkedBoxes = $(".checkboxed input:checkbox:checked");
923             var numchecked = $(checkedBoxes).size();
924             if (numchecked) {
925                 if( numchecked > 1 ){
926                     return confirmDelete(MSG_REMOVE_FROM_LIST);
927                 } else {
928                     return confirmDelete(MSG_REMOVE_ONE_FROM_LIST);
929                 }
930             } else {
931                 alert(MSG_NO_RECORD_SELECTED);
932                 return false;
933             }
934         });
935         $("#removeitems").html("<a href=\"#\" class=\"btn btn-link disabled removeitems tag_hides\"><i class=\"fa fa-fw fa-remove\" aria-hidden=\"true\"></i> "+_("Remove from list")+"</a>")
936         .click(function(){
937             $("#myform").submit();
938             return false;
939         });
940     [% END %]
941     [% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %]
942     [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
943     [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
944     [% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %]
945         KOHA.coce.getURL('[% Koha.Preference('CoceHost') | html %]', '[% Koha.Preference('CoceProviders') | html %]');
946     [% END %]
947
948     [% IF print %]
949         window.print();
950         window.onafterprint = function () {
951             window.close();
952         }
953         setTimeout('window.close()', 1000); // Hack for Chrome < 63
954     [% END %]
955
956     AdjustRemark();
957
958     Sticky = $("#floating");
959     Sticky.hcSticky({
960         stickTo: "#usershelves",
961         stickyClass: "floating"
962     });
963
964     [% IF itemsloop %]
965         sortMenu( $("#sorting-form") );
966
967         $("#sortfield").on("change", function(){
968             $('#sorting-form').submit();
969         });
970     [% END %]
971
972     $(".deleteshelf").on("click", function(e){
973         e.preventDefault();
974         var shelf_name = $(this).data("shelfname");
975         var shelf_number = $(this).data("shelfnumber");
976         var is_shared = $(this).data("shared");
977         var count = $(this).data("count");
978         var message = "<p><i>" + shelf_name + "</i></p>";
979         if( count ){
980             message += "<p>" + _("Items on this list:") + " <strong>" + count + "</strong></p>";
981         }
982         if( is_shared ){
983             message += "<p>" + _("This list is shared. Other users will lose access to it.") + "</p>";
984         }
985         confirmModal( message, _("Are you sure you want to delete this list?"), _("Yes, delete"), _("No, do not delete"), function( result ){
986                 if( result ){
987                     $("#deleteshelf" + shelf_number ).submit();
988                 }
989             }
990         );
991     });
992
993     $(".remove_share").on("click", function(e){
994         e.preventDefault();
995         var shelf_name = $(this).data("shelfname");
996         var shelf_number = $(this).data("shelfnumber");
997         confirmModal( shelf_name, _("Are you sure you want to remove sharing? You will no longer have access to the list."), _("Yes, remove sharing"), _("No, do not remove sharing"), function( result ){
998                 if( result ){
999                     $("#unshare" + shelf_number ).submit();
1000                 }
1001             }
1002         );
1003     });
1004
1005 }); // document.ready
1006
1007 function sortMenu( sorting_form ){
1008     var shelfnumber = sorting_form.find("input[name='shelfnumber']").val();
1009     var sort_link = "/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=" + shelfnumber + "&sortfield=";
1010     var menu = "<div class=\"btn-group\"><button type=\"button\" class=\"btn btn-link dropdown-toggle\" data-toggle=\"dropdown\" id=\"sortmenu\" aria-haspopup=\"true\" aria-expanded=\"false\"><i class=\"fa fa-sort\" aria-hidden=\"true\"></i> " + _("Sort") + "</span></button><ul class=\"dropdown-menu dropdown-menu-right\" aria-labelledby=\"sortmenu\">";
1011     $("#sortfield").children().each(function(){
1012         if( $(this)[0].tagName.toUpperCase() == "OPTION" ){
1013             menu += "<li><a href=\"" + sort_link + $(this).val() + "\">" + $(this).text() + "</a></li>";
1014         } else if( $(this)[0].tagName.toUpperCase() == "OPTGROUP" ){
1015             menu += "<li class=\"dropdown-header\">" + $(this).attr("label") + "</li>";
1016             $(this).children().each(function(){
1017                 if( $(this)[0].tagName.toUpperCase() == "OPTION" ){
1018                     menu += "<li><a href=\"" + sort_link + $(this).val() + "\">" + $(this).text() + "</a></li>";
1019                 }
1020             });
1021         }
1022     });
1023     menu += "</ul></div>";
1024     $(".list-actions").append( menu );
1025     sorting_form.remove();
1026 }
1027
1028 function AdjustRemark() {
1029     var category;
1030     if( $("#category").length > 0 ) {
1031         category = $("#category").val();
1032     } else {
1033         category = [% category | html %];
1034     }
1035     var perms = $("#allow_changes_from").val();
1036
1037     if( perms < 2 ) {
1038         $("#anyone_remark").hide();
1039     } else if( category==1 ) {
1040         // If we move to Private (without shares), show Anyone remark
1041         // Note: the number of shares is not tested real-time
1042         [% IF !shelf.is_shared %]
1043             $("#anyone_remark").show();
1044         [% ELSE %]
1045             $("#anyone_remark").hide();
1046         [% END %]
1047     } else { // category==2
1048         $("#anyone_remark").hide();
1049     }
1050 }
1051 </script>
1052 [% END %]