Bug 28242: added captions to tables and legends to forms
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-results.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnList ) %]
5 [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnList ) %]
6 [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
7 [% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
8
9 [% IF firstPage %]
10      [% SET OverDriveEnabled = Koha.Preference('OverDriveLibraryID') && Koha.Preference('OverDriveClientKey') && Koha.Preference('OverDriveClientSecret') %]
11      [% SET RecordedBooksEnabled = Koha.Preference('RecordedBooksLibraryID') && Koha.Preference('RecordedBooksClientSecret') %]
12 [% END %]
13
14 [% INCLUDE 'doc-head-open.inc' %]
15 <title>
16 [% IF ( searchdesc ) %]
17     [% IF ( ms_value ) %]
18         Results of search for '[% ms_value | html %]'
19     [% ELSE %]
20         Search results
21     [% END %]
22 [% ELSE %]
23     You did not specify any search criteria.
24 [% END %]
25 &rsaquo;
26 [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog
27 </title>
28 [% INCLUDE 'doc-head-close.inc' %]
29
30 <link rel="alternate" type="application/rss+xml" title="[% LibraryName | html %] Search RSS feed" href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;count=[% countrss |uri %]&amp;sort_by=acqdate_dsc&amp;format=rss" />
31 </head>
32 [% BLOCK cssinclude %][% END %]
33 [% INCLUDE 'bodytag.inc' bodyid='results' bodyclass='scrollto' %]
34 [% INCLUDE 'masthead.inc' %]
35
36     <div class="main">
37         <nav aria-label="breadcrumb">
38             <ul class="breadcrumb">
39                 <li class="breadcrumb-item">
40                     <a href="/cgi-bin/koha/opac-main.pl">Home</a>
41                 </li>
42                 [% IF ( searchdesc ) %]
43                     [% IF ( ReturnPath ) %]
44                         <li class="breadcrumb-item">
45                             <a href="[% ReturnPath | url %]">Advanced search</a>
46                         </li>
47                     [% END %]
48                     <li class="breadcrumb-item active" aria-current="page">
49                         [% IF ( ms_value ) %]
50                             <a href="#" title="You searched [% IF ( query_desc ) %] for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc | html %]'[% END %]">Results of search for '[% ms_value | html %]'</a>
51                         [% ELSE %]
52                             <a href="#" title="You searched [% IF ( query_desc ) %] for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc | html %]'[% END %]">Search results</a>
53                         [% END %]
54                     </li>
55                 [% ELSE %]
56                     <li class="breadcrumb-item active" aria-current="page">
57                         <a href="#">You did not specify any search criteria</a>
58                     </li>
59                 [% END %]
60             </ul>
61         </nav>
62
63         [% UNLESS ( total ) %]
64             <div class="container-fluid">
65                 <div class="row">
66                     <div class="col">
67                         <h1 id="numresults">No results found!</h1>
68                         <p>
69                             [% IF ( searchdesc ) %]
70                                 No results found for that in [% LibraryName | html %] catalog.
71                                 <a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;format=rss" aria-label="Subscribe to this search" class="btn btn-link rsssearchlink noprint">
72                                     <i class="fa fa-rss rsssearchicon" aria-hidden="true" title="Subscribe to this search"></i>
73                                 </a>
74                             [% ELSE %]
75                                 You did not specify any search criteria.
76                             [% END %]
77                         </p>
78                         [% IF ( ReturnPath ) %]
79                            <div class="returntosearch">
80                                 <p><a href="[% ReturnPath | url %]">Return to the last advanced search</a></p>
81                             </div>
82                         [% END %]
83                         [% IF ( OPACNoResultsFound ) %]
84                             <div id="noresultsfound">
85                                 [% OPACNoResultsFound | $raw %]
86                             </div>
87                         [% END %]
88                     </div> <!-- / .col -->
89                 </div> <!-- / .row -->
90             </div> <!-- / .container-fluid -->
91         [% END # / UNLESS searchdesc %]
92
93         <div class="container-fluid">
94             <div class="row">
95                 [% IF ( opacfacets && total ) %]
96                     <div class="col-lg-2">
97                         <div id="facetcontainer">
98                             <!-- FACETS START -->
99                             [% INCLUDE 'opac-facets.inc' %]
100                             <!-- FACETS END -->
101                         </div>
102                     </div>
103                 [% END %]
104
105                 [% IF ( total ) %]
106                     [% IF ( opacfacets ) %]
107                         <div class="col-lg-10 order-first order-md-first order-lg-2 maincontent">
108                     [% ELSE %]
109                         <div class="col order-first order-md-first order-lg-2 maincontent">
110                    [% END %]
111                 [% ELSE %]
112                     [% IF ( opacfacets ) %]
113                         <div class="col-lg-10 order-first order-md-first order-lg-2">
114                     [% ELSE %]
115                         <div class="col order-first order-md-first order-lg-2">
116                     [% END %]
117                 [% END %]
118
119                 [% IF ( searchdesc ) %]
120                     [% IF ( total ) %]
121                         <h1 id="numresults">
122                             Your search returned [% total | html %] results.
123                             <a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;format=rss" class="btn btn-link rsssearchlink noprint" aria-label="Subscribe to this search">
124                                 <i class="fa fa-rss rsssearchicon" aria-hidden="true" title="Subscribe to this search"></i>
125                             </a>
126                         </h1>
127                         [% IF ( related ) %]
128                             <p>(related searches:[% FOREACH relate IN related %] [% relate.related_search | html %][% END %]).</p>
129                         [% END %]
130                     [% END # / IF total %]
131                 [% END # / IF searchdesc %]
132
133                 <div id="userresults">
134                     [% IF ( DidYouMean ) %]
135                         <div id="didyoumean">Not what you expected? Check for <a href="/cgi-bin/koha/svc/suggestion?render=standalone&amp;q=[% querystring | uri %]">suggestions</a></div>
136                     [% END %]
137
138                     [% IF ( koha_spsuggest ) %]
139                         Did you mean:
140                         <ul style="list-style: none;">
141                             [% FOREACH SPELL_SUGGES IN SPELL_SUGGEST %]
142                             <li>
143                                 <a href="/cgi-bin/koha/opac-search.pl?q=[% SPELL_SUGGES.spsuggestion | uri %]">[% SPELL_SUGGES.spsuggestion | html %]</a>
144                             </li>
145                             [% END %]
146                         </ul>
147                     [% END # / IF koha_spsuggest%]
148                     [% IF ( total ) %]
149                         [% IF ( ReturnPath ) %]
150                             <div class="returntosearch">
151                                 <p><a href="[% ReturnPath | url %]">Return to the last advanced search</a></p>
152                             </div>
153                         [% END %]
154                     [% END %]
155                     [% IF ( query_error ) %]
156                         <div class="dialog alert">
157                             <h2>Error:</h2>
158                             [% query_error | html %]
159                         </div>
160                     [% END %]
161
162                     <!-- Search Results Table -->
163                     [% IF ( total ) %]
164
165                         <div class="searchresults">
166                             <form action="/cgi-bin/koha/opac-search.pl" method="get" name="bookbag_form" id="bookbag_form">
167                                 <legend class="sr-only">Sort</legend>
168                                 [% IF ( searchdesc ) %]
169                                     [% FOREACH QUERY_INPUT IN QUERY_INPUTS %]
170                                         <input type="hidden" name="[% QUERY_INPUT.input_name | html %]" value="[% QUERY_INPUT.input_value | html %]"/>
171                                     [% END %]
172                                     [% FOREACH LIMIT_INPUT IN LIMIT_INPUTS %]
173                                         <input type="hidden" name="[% LIMIT_INPUT.input_name | html %]" value="[% LIMIT_INPUT.input_value | html %]"/>
174                                     [% END %]
175                                 [% END # IF /searchdesc %]
176
177                                 <div id="floating">
178                                     <div id="toolbar" class="toolbar row align-items-center">
179                                         <div id="top-pages" class="col">
180                                             [% INCLUDE 'page-numbers.inc' %]
181                                         </div>
182                                         [% UNLESS tag %]
183                                             <div class="sort_by col-sm-auto">
184                                                 <label for="sort_by" class="sr-only">Sort by:</label>
185                                                 <select id="sort_by" class="resort form-control form-control-sm" name="sort_by">
186                                                     [% INCLUDE 'resort_form.inc' %]
187                                                 </select>
188
189                                                 [% IF Koha.Preference('OPACnumSearchResultsDropdown') %]
190                                                     <label for="results_per_page">Results per page: </label>
191                                                     <select id="results_per_page" name="count">
192                                                         [% IF Koha.Preference('OPACnumSearchResults') %]
193                                                             [% IF results_per_page == Koha.Preference('OPACnumSearchResults') %]
194                                                                 <option value="[% Koha.Preference('OPACnumSearchResults') | html %]" selected="selected">Library default: [% Koha.Preference('OPACnumSearchResults') | html %]</option>
195                                                             [% ELSE %]
196                                                                 <option value="[% Koha.Preference('OPACnumSearchResults') | html %]">Library default: [% Koha.Preference('OPACnumSearchResults') | html %]</option>
197                                                             [% END %]
198                                                         [% END %]
199                                                         [% IF results_per_page == '20' %]<option value="20" selected="selected">20</option>[% ELSE %]<option value="20">20</option>[% END %]
200                                                         [% IF results_per_page == '40' %]<option value="40" selected="selected">40</option>[% ELSE %]<option value="40">40</option>[% END %]
201                                                         [% IF results_per_page == '60' %]<option value="60" selected="selected">60</option>[% ELSE %]<option value="60">60</option>[% END %]
202                                                         [% IF results_per_page == '80' %]<option value="80" selected="selected">80</option>[% ELSE %]<option value="80">80</option>[% END %]
203                                                         [% IF results_per_page == '100' %]<option value="100" selected="selected">100</option>[% ELSE %]<option value="100">100</option>[% END %]
204                                                     </select>
205                                                 [% END # IF Koha.Preference('OPACnumSearchResultsDropdown') %]
206                                             </div> <!-- /.sort_by -->
207                                             <div id="sortsubmit" class="sort_by col-auto">
208                                                 <input type="submit" class="btn btn-primary btn-sm clearfix" value="Go" />
209                                             </div> <!-- /.sort_by -->
210                                         [% END # /UNLESS tag %]
211                                     </div> <!-- / #toolbar -->
212
213                                     <div class="selections-toolbar toolbar noprint">
214                                         [% IF ( OpacHighlightedWords ) %]
215                                             <div class="highlight_controls noprint">
216                                                 <a href="#" class="btn btn-link btn-sm highlight_toggle" id="highlight_toggle_off"><i class="fa fa-fw fa-pencil" aria-hidden="true"></i> Unhighlight</a>
217                                                 <a href="#" class="btn btn-link btn-sm highlight_toggle" id="highlight_toggle_on"><i class="fa fa-fw fa-pencil" aria-hidden="true"></i> Highlight</a>
218                                             </div>
219                                         [% END %]
220
221                                         <div class="check_control">
222                                             <!-- checkall, clearall are now needed for placehold -->
223                                             <span class="clearall">
224                                                 <a id="CheckAll" class="btn btn-link btn-sm" href="#">Select all</a>
225                                             </span>
226                                             <span class="checkall">
227                                                 <a id="CheckNone" class="btn btn-link btn-sm" href="#">Clear all</a>
228                                             </span>
229                                         </div>
230
231                                         <div class="links">
232                                             [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) || loggedinusername ) %]
233                                                 <span class="selections">Select titles to:</span>
234                                             [% END %]
235                                             [% IF Koha.Preference( 'opacbookbag' ) == 1 OR Koha.Preference('virtualshelves') %]
236                                                 <span class="addto">
237                                                     <select class="disabled form-control form-control-sm" name="addto" id="addto">
238                                                         <option>Add to...</option>
239                                                         [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
240                                                             <option value="addtocart">Cart</option>
241                                                         [% END %]
242                                                         [% IF Koha.Preference('virtualshelves') %]
243                                                             [% IF loggedinusername AND add_to_some_private_shelves.count %]
244                                                                 <optgroup label="Your lists:">
245                                                                 [% SET number_of_private_shelves = 0 %]
246                                                                 [% FOREACH s IN add_to_some_private_shelves %]
247                                                                     [% IF shelfnumber != s.shelfnumber %]
248                                                                         <option id="s[% s.shelfnumber | html %]" value="addtolist">[% s.shelfname | html %]</option>
249                                                                         [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
250                                                                         [% IF number_of_private_shelves == 10 %][% LAST %][% END %]
251                                                                     [% END %]
252                                                                 [% END %]
253                                                                 </optgroup>
254                                                             [% END %]
255                                                             [% IF add_to_some_public_shelves.count %]
256                                                                 <optgroup label="Public lists:">
257                                                                 [% SET number_of_public_shelves = 0 %]
258                                                                 [% FOREACH s IN add_to_some_public_shelves %]
259                                                                     [% IF shelfnumber != s.shelfnumber %]
260                                                                         <option id="s[% s.shelfnumber | html %]" value="addtolist">[% s.shelfname | html %]</option>
261                                                                         [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
262                                                                         [% IF number_of_public_shelves == 10 %][% LAST %][% END %]
263                                                                     [% END %]
264                                                                 [% END %]
265                                                                 </optgroup>
266                                                             [% END %]
267                                                             [% IF ( add_to_some_private_shelves and add_to_some_private_shelves.count > 10 ) or ( add_to_some_public_shelves and add_to_some_public_shelves.count > 10 ) %]
268                                                                 <option value="morelists">[ More lists ]</option>
269                                                             [% END %]
270                                                             <option value="newlist">[ New list ]</option>
271                                                         [% END # /IF virtualshelves %]
272                                                     </select>
273                                                     <input type="submit" class="btn btn-sm btn-primary" value="Save" />
274                                                 </span>
275                                             [% END # /IF opacbookbag || virtualshelves %]
276
277                                             [% IF ( ( Koha.Preference( 'RequestOnOpac' ) == 1 ) && ( Koha.Preference( 'opacuserlogin' ) == 1 ) && DisplayMultiPlaceHold ) %]
278                                                 <button class="btn btn-link btn-sm hold disabled" type="button">
279                                                     <i class="fa fa-fw fa-bookmark" aria-hidden="true"></i> Place hold
280                                                 </button>
281                                             [% END %]
282
283                                             [% IF ( TagsInputEnabled && loggedinusername ) %]
284                                                 <span id="tagsel_span">
285                                                     <button id="tagsel_tag" class="btn btn-link btn-sm disabled" type="submit" style="display:none"><i class="fa fa-fw fa-tag" aria-hidden="true"></i> Tag</button>
286                                                 </span>
287                                             [% END %]
288                                         </div> <!-- / .links -->
289                                         [% IF ( TagsInputEnabled && loggedinusername ) %]
290                                             <div id="tagsel_form" style="display:none">
291                                                 <label for="tagsel_new">New tag:</label>
292                                                 <input type="text" name="tagsel_new" id="tagsel_new" maxlength="100" />
293                                                 <input id="tagsel_button" name="tagsel_button" class="tagsel_button btn btn-sm btn-primary" title="Add" type="submit" value="Add" />
294                                                 <a href="#" id="tagsel_cancel">(done)</a>
295                                             </div>
296                                             <div id="tagsel_status" class="tagsel_tatus" style="display:none;">
297                                                 Tag status here.
298                                             </div>
299                                         [% END %]
300                                     </div> <!-- / .selections-toolbar -->
301                                 </div> <!-- /#floating -->
302
303                                 <!-- TABLE RESULTS START -->
304                                 <table class="table table-striped">
305                                     <caption class="sr-only">Results</caption>
306
307                                     <!-- Actual Search Results -->
308                                     [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
309                                         <tr>
310                                             [% # Cell 1: Checkbox %]
311                                             [% IF ( SEARCH_RESULT.title ) %]
312                                                 [% check_title = SEARCH_RESULT.title %]
313                                             [% ELSE %]
314                                                 [% check_title = SEARCH_RESULT.biblionumber %]
315                                             [% END %]
316                                             <td class="selectcol">
317                                                 [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
318                                                     <input type="checkbox" class="cb" id="bib[% SEARCH_RESULT.biblionumber | html %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber | html %]" aria-label="Select search result: [% check_title | html %]" /> <label for="bib[% SEARCH_RESULT.biblionumber | html %]"></label>
319                                                 [% ELSE %]
320                                                     [% IF Koha.Preference( 'virtualshelves' ) == 1 %]
321                                                         <input type="checkbox" class="cb" id="bib[% SEARCH_RESULT.biblionumber | html %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber | html %]" aria-label="Select search result: [% check_title | html %]"/> <label for="bib[% SEARCH_RESULT.biblionumber | html %]"></label>
322                                                     [% ELSE %]
323                                                         [% IF Koha.Preference( 'RequestOnOpac' ) == 1 %]
324                                                             [% UNLESS ( SEARCH_RESULT.norequests ) %]
325                                                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]<input type="checkbox" class="cb" id="bib[% SEARCH_RESULT.biblionumber | html %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber | html %]" aria-label="Select search result: [% check_title | html %]"/> <label for="bib[% SEARCH_RESULT.biblionumber | html %]"></label>
326                                                                 [% END %]
327                                                             [% END %]
328                                                         [% END # IF RequestOnOpac %]
329                                                     [% END # IF virtualshelves %]
330                                                 [% END # IF opacbookbag%]
331                                             </td>
332
333                                             [% # Cell 2: Show result number if OpacHiddenItems is empty %]
334                                             <td class="numcol[%- IF suppress_result_number -%] hidden[%- END -%]">
335                                                 [% UNLESS suppress_result_number %]
336                                                     [% SEARCH_RESULT.result_number | html %].
337                                                 [% END %]
338                                             </td>
339
340                                             [% IF ( !item_level_itypes || Koha.Preference('BiblioItemtypeInfo') ) && !Koha.Preference('OpacNoItemTypeImages') %]
341                                                 [% # Cell 3: Show item type image %]
342                                                 <td class="itypecol">
343                                                     [% IF ( SEARCH_RESULT.imageurl ) %]
344                                                         <img src="[% SEARCH_RESULT.imageurl | html %]" title="[% SEARCH_RESULT.description | html %]" alt="[% SEARCH_RESULT.description | html %]" />
345                                                     [% END %]
346                                                     [% IF ( SEARCH_RESULT.score_avg ) %]
347                                                         <img src="[% themelang | html %]/../images/bonus.png" title="bonus" style="max-height: 35px;"/>
348                                                     [% END %]
349                                                 </td>
350                                             [% END %]
351
352                                             [% # Cell 4: Search result details and controls %]
353                                             <td class="bibliocol">
354                                                 <div class="coverimages itemtype_[% SEARCH_RESULT.itemtype | html %]">
355                                                     <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]">
356                                                         [% IF ( SEARCH_RESULT.title ) %]
357                                                             [% img_title = SEARCH_RESULT.title %]
358                                                         [% ELSE %]
359                                                             [% img_title = SEARCH_RESULT.biblionumber %]
360                                                         [% END %]
361                                                         [% IF ( OPACLocalCoverImages ) %]
362                                                             <span title="[% img_title | html %]" class="[% SEARCH_RESULT.biblionumber | html %]" id="local-thumbnail[% loop.count | html %]"></span>
363                                                         [% END %]
364
365                                                         [% IF ( AdlibrisEnabled && SEARCH_RESULT.normalized_isbn ) %]
366                                                             <span title="[% img_title | html %]" id="adlibris-thumbnail[% loop.count | html %]">
367                                                                 <img src="[% AdlibrisURL | html %]?isbn=[% SEARCH_RESULT.normalized_isbn | html %]"
368                                                                      alt="Adlibris thumbnail for ISBN: [% SEARCH_RESULT.normalized_isbn | html %]" class="adlibris-cover" />
369                                                             </span>
370                                                         [% END %]
371                                                         [% IF ( OPACAmazonCoverImages ) %]
372                                                             [% IF ( SEARCH_RESULT.normalized_isbn ) %]
373                                                                     <span title="[% img_title | html %]" id="amazon-thumbnail[% loop.count | html %]"><img src="https://images-na.ssl-images-amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn | html %].01.TZZZZZZZ.jpg" alt="" class="item-thumbnail" /></span>
374                                                             [% ELSE %]
375                                                                 <span class="no-image">No cover image available</span>
376                                                             [% END %]
377                                                         [% END %]
378
379                                                         [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
380                                                             [% IF ( SEARCH_RESULT.normalized_isbn || SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_oclc ) %]
381                                                                     <span title="[% img_title | html %]" id="syndetics-thumbnail[% loop.count | html %]"><img src="https://secure.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn | html %]/SC.GIF&amp;client=[% SyndeticsClientCode | html %]&amp;type=xw10&amp;upc=[% SEARCH_RESULT.normalized_upc | html %]&amp;oclc=[% SEARCH_RESULT.normalized_oclc | html %]" alt="" class="item-thumbnail" /></span>
382                                                             [% ELSE %]
383                                                                 <span class="no-image">No cover image available</span>
384                                                             [% END %]
385                                                         [% END %]
386
387                                                         [% IF ( GoogleJackets ) %]
388                                                             [% IF ( SEARCH_RESULT.normalized_isbn ) %]
389                                                                 <span title="[% img_title | html %]" class="[% SEARCH_RESULT.normalized_isbn | html %]" id="gbs-thumbnail[% loop.count | html %]"></span>
390                                                             [% ELSE %]
391                                                                 <span class="no-image">No cover image available</span>
392                                                             [% END %]
393                                                         [% END %]
394
395                                                         [% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %]
396                                                           [% coce_id = SEARCH_RESULT.normalized_ean || SEARCH_RESULT.normalized_isbn | html %]
397                                                           [% IF ( coce_id ) %]
398                                                             <span title="[% img_title | html %]" class="[% coce_id | html %]" id="coce-thumbnail[% loop.count | html %]"></span>
399                                                           [% ELSE %]
400                                                             <span class="no-image">No cover image available</span>
401                                                           [% END %]
402                                                         [% END %]
403
404                                                         [% IF OpenLibraryCovers %]
405                                                             [% IF SEARCH_RESULT.normalized_isbn %]
406                                                                 <span title="[% img_title | html %]" class="[% SEARCH_RESULT.normalized_isbn | html %]" id="openlibrary-thumbnail[% loop.count | html %]"></span>
407                                                             [% ELSE %]
408                                                                 <span class="no-image">No cover image available</span>
409                                                             [% END %]
410                                                         [% END %]
411
412                                                         [% IF ( BakerTaylorEnabled && !BakerTaylorBookstoreURL ) %]
413                                                             [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %]
414                                                             [% IF ( bt_id ) %]
415                                                                 <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" />
416                                                             [% ELSE %]
417                                                                 <span class="no-image">No cover image available</span>
418                                                             [% END %]
419                                                         [% END %]
420                                                     </a>
421
422                                                     [% IF ( BakerTaylorEnabled && BakerTaylorBookstoreURL ) %]
423                                                         [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %]
424                                                         [% IF ( bt_id ) %]
425                                                             <a href="https://[% BakerTaylorBookstoreURL | url %][% bt_id | url %]">
426                                                                 <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" />
427                                                             </a>
428                                                         [% ELSE %]
429                                                             <span class="no-image">No cover image available</span>
430                                                         [% END %]
431                                                     [% END %]
432
433                                                     [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %]
434                                                         [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
435                                                         [% IF custom_cover_image_url %]
436                                                             [% IF ( OPACURLOpenInNewWindow ) %]
437                                                                 <a class="custom_cover_image" href="[% custom_cover_image_url | url %]" target="_blank" rel="noreferrer"><img alt="Cover image" src="[% custom_cover_image_url | url %]" /></a>
438                                                             [% ELSE %]
439                                                                 <a class="custom_cover_image" href="[% custom_cover_image_url | url %]"><img alt="Cover image" src="[% custom_cover_image_url | url %]" /></a>
440                                                             [% END %]
441                                                         [% END %]
442                                                     [% END %]
443
444                                                 </div>
445                                                 [% IF ( COinSinOPACResults && SEARCH_RESULT.coins ) %]
446                                                     <!-- COinS / Openurl -->
447                                                     <span class="Z3988" title="[% SEARCH_RESULT.coins | html %]"></span>
448                                                 [% END %]
449                                                 <div id="title_summary_[% SEARCH_RESULT.biblionumber | html %]" class="title_summary">
450                                                 [% IF ( OPACXSLTResultsDisplay ) %]
451                                                     [% SEARCH_RESULT.XSLTResultsRecord | $raw %]
452                                                 [% ELSE %]
453                                                     [% IF ( BiblioDefaultViewmarc ) %]
454                                                         <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | url %]" title="View details for this title">
455                                                     [% ELSE %]
456                                                         [% IF ( BiblioDefaultViewisbd ) %]
457                                                             <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | url %]" title="View details for this title">
458                                                         [% ELSE %]
459                                                             <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | url %]" title="View details for this title">
460                                                         [% END %]
461                                                     [% END %]
462
463                                                     [% INCLUDE 'biblio-title.inc' biblio=SEARCH_RESULT %]
464
465                                                     [% IF ( SEARCH_RESULT.author ) %]
466                                                         by <a href="/cgi-bin/koha/opac-search.pl?q=au:[% SEARCH_RESULT.author | url %]" title="Search for works by this author" class="author">[% SEARCH_RESULT.author | html %]</a>
467                                                     [% ELSE %]
468                                                         &nbsp;
469                                                     [% END %]
470
471                                                     <span class="results_summary publisher">
472                                                         <span class="label">Publication:</span>
473                                                             [% IF ( SEARCH_RESULT.place ) %][% SEARCH_RESULT.place | html %] [% END %]
474                                                             [% IF ( SEARCH_RESULT.publishercode ) %][% SEARCH_RESULT.publishercode | html %][% END %]
475                                                             [% IF ( SEARCH_RESULT.publicationyear ) %]
476                                                                 [% SEARCH_RESULT.publicationyear | html %]
477                                                             [% ELSE %]
478                                                                 [% IF ( SEARCH_RESULT.copyrightdate ) %]
479                                                                     [% SEARCH_RESULT.copyrightdate | html %]
480                                                                 [% END %]
481                                                             [% END %]
482                                                             [% IF ( SEARCH_RESULT.pages ) %]. [% SEARCH_RESULT.pages | html %][% END %]
483                                                             [% IF ( SEARCH_RESULT.notes ) %], [% SEARCH_RESULT.notes | html %][% END %]
484                                                             [% IF ( SEARCH_RESULT.size ) %] [% SEARCH_RESULT.size | html %][% END %]
485                                                             [% IF ( SEARCH_RESULT.timestamp ) %] <em>(modified on [% SEARCH_RESULT.timestamp | html %])</em>[% END %]
486                                                     </span>
487
488                                                     [% IF ( SEARCH_RESULT.summary ) %]
489                                                         <span class="result_summary">
490                                                             [% SEARCH_RESULT.summary | html %]
491                                                         </span>
492                                                     [% END %]
493
494                                                     [% IF ( SEARCH_RESULT.copyrightdate ) %]
495                                                         <span class="results_summary date">
496                                                             <span class="label">Date:</span>
497                                                             [% SEARCH_RESULT.copyrightdate | html %]
498                                                         </span>
499                                                     [% END %]
500
501                                                     <span class="results_summary">
502                                                         <span class="label">Availability:</span>
503                                                             [% IF ( SEARCH_RESULT.available_items_loop.size() ) %]
504                                                                 <span class="available"><strong>Items available:</strong>
505                                                                     [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
506                                                                         [% IF available_items_loo.this_branch %]
507                                                                             <span class="highlight-row-results">
508                                                                         [% ELSE %]
509                                                                             <span>
510                                                                         [% END %]
511
512                                                                         [% IF ( singleBranchMode ) %]
513                                                                             <span class="shelvingloc">[% available_items_loo.location | html %]</span>
514                                                                         [% ELSE %]
515                                                                             [% available_items_loo.branchname | html %]
516                                                                         [% END %]
517
518                                                                         [% IF ( OPACItemsResultsDisplay ) %]
519                                                                             [% UNLESS ( singleBranchMode ) %]<span class="shelvingloc">[% available_items_loo.location | html %]</span>[% END %]
520                                                                             [% IF ( available_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/opac-search.pl?q=callnum:%22[% available_items_loo.itemcallnumber | url %]%22">[% available_items_loo.itemcallnumber | html %]</a>][% END %]
521                                                                         [% END %]
522                                                                         ([% available_items_loo.count | html %]),
523                                                                         </span>
524                                                                     [% END # / FOREACH available_items_loo %]
525                                                                 </span>
526                                                             [% ELSE %]
527                                                                 [% IF ( SEARCH_RESULT.ALTERNATEHOLDINGS ) %]
528                                                                     [% FOREACH ALTERNATEHOLDING IN SEARCH_RESULT.ALTERNATEHOLDINGS %]
529                                                                         &nbsp;<span id="alternateholdings">[% ALTERNATEHOLDING.holding | html %]</span>,
530                                                                     [% END %]
531                                                                 [% ELSE %]
532                                                                     <span class="unavailable">No items available:</span>
533                                                                 [% END %]
534                                                             [% END # / IF SEARCH_RESULT.available_items_loop.size %]
535
536                                                             <span class="unavailable">
537                                                                 [% IF ( SEARCH_RESULT.onloancount ) %] Checked out ([% SEARCH_RESULT.onloancount | html %]), [% END %]
538                                                                 [% IF ( SEARCH_RESULT.withdrawncount ) %] Withdrawn ([% SEARCH_RESULT.withdrawncount | html %]), [% END %]
539                                                                 [% UNLESS ( SEARCH_RESULT.hidelostitems ) %][% IF ( SEARCH_RESULT.itemlostcount ) %] Lost ([% SEARCH_RESULT.itemlostcount | html %]),[% END %][% END %]
540                                                                 [% IF ( SEARCH_RESULT.damagedcount ) %] Damaged ([% SEARCH_RESULT.damagedcount | html %]),[% END %]
541                                                                 [% IF ( SEARCH_RESULT.orderedcount ) %] On order ([% SEARCH_RESULT.orderedcount | html %]),[% END %]
542                                                                 [% IF ( SEARCH_RESULT.onholdcount ) %] On hold ([% SEARCH_RESULT.onholdcount | html %]),[% END %]
543                                                                 [% IF ( SEARCH_RESULT.intransitcount ) %] In transit ([% SEARCH_RESULT.intransitcount | html %]),[% END %]
544                                                             </span>
545                                                     </span> <!-- / .results_summary -->
546                                                 [% END # / IF OPACXSLTResultsDisplay %]
547
548                                                 [% IF ( SEARCH_RESULT.score_avg ) %]
549                                                     <div class="results_summary">
550                                                         [% FOREACH i  IN [ 1 2 3 4 5  ] %]
551                                                             [% IF ( SEARCH_RESULT.score_int >= i ) %]
552                                                                 <div class="star-rating rater-[% i | html %] star star-rating-applied star-rating-readonly star-rating-on"><a title="[% i | html %]">[% i | html %]</a></div>
553                                                             [% ELSE   %]
554                                                                 <div class="star-rating rater-[% i | html %] star star-rating-applied star-rating-readonly"><a title="[% i | html %]">[% i | html %]</a></div>
555                                                             [% END %]
556                                                         [% END %]
557                                                         <span id="babeltheque-rating_total_[% SEARCH_RESULT.biblionumber | html %]">&nbsp;&nbsp; [% SEARCH_RESULT.score_avg | html %] / 5 (on [% SEARCH_RESULT.num_scores | html %] rates)</span>
558
559                                                         [% IF ( SEARCH_RESULT.num_critics ) %]
560                                                             <span class="social_data">[% SEARCH_RESULT.num_critics | html %] Internet user critics</span>
561                                                         [% END %]
562                                                         [% IF ( SEARCH_RESULT.num_critics_pro ) %]
563                                                             <span class="social_data">[% SEARCH_RESULT.num_critics_pro | html %] Professional critics</span>
564                                                         [% END %]
565                                                         [% IF ( SEARCH_RESULT.num_videos ) %]
566                                                             <span class="social_data">[% SEARCH_RESULT.num_videos | html %] Video extracts</span>
567                                                         [% END %]
568                                                         [% IF ( SEARCH_RESULT.num_quotations ) %]
569                                                             <span class="social_data">[% SEARCH_RESULT.num_quotations | html %] Quotations</span>
570                                                         [% END %]
571                                                     </div> <!-- / .results_summary -->
572                                                 [% END # / IF SEARCH_RESULT.score_avg %]
573
574                                                 [% IF ( LibraryThingForLibrariesID ) %]
575                                                     <div class="ltfl_reviews"></div>
576                                                 [% END %]
577
578                                                 [% IF ( TagsShowEnabled && SEARCH_RESULT.TagLoop.size ) %]
579                                                     <div class="results_summary tags">
580                                                         <span class="label">Tags:</span>
581                                                         <ul>
582                                                             [% FOREACH TagLoo IN SEARCH_RESULT.TagLoop %]
583                                                                 <li>
584                                                                     <a href="/cgi-bin/koha/opac-search.pl?tag=[% TagLoo.term | url %]&amp;q=[% TagLoo.term |url %]">[% TagLoo.term | html %]</a>
585                                                                     <span class="weight">([% TagLoo.weight_total | html %])</span>
586                                                                 </li>
587                                                             [% END %]
588                                                         </ul>
589                                                     </div>
590                                                 [% END %]
591
592                                                 [% IF Koha.Preference('virtualshelves') AND SEARCH_RESULT.shelves.count %]
593                                                     <div class="results_summary shelves">
594                                                         <span class="label">Lists:</span>
595                                                         <ul>
596                                                             [% FOREACH shelf IN SEARCH_RESULT.shelves %]
597                                                                 <li>
598                                                                     <a href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% shelf.shelfnumber | uri %]">[% shelf.shelfname | html %]</a>
599                                                                     [%~ UNLESS loop.last %], [% ELSE %].[% END ~%]
600                                                                 </li>
601                                                             [% END %]
602                                                         </ul>
603                                                     </div>
604                                                 [% END %]
605
606                                                 [% IF ( SEARCH_RESULT.searchhighlightblob ) %]
607                                                     <span class="results_summary">
608                                                         <span class="label">Match:</span>
609                                                         [% SEARCH_RESULT.searchhighlightblob | html %]
610                                                     </span>
611                                                 [% END %]
612
613                                                 [% INCLUDE "openlibrary-readapi.inc" bib = SEARCH_RESULT %]
614
615                                                 [% IF ( OpacStarRatings == 'all' ) %]
616                                                     <div class="results_summary ratings">
617                                                         [% SET rating_avg = SEARCH_RESULT.ratings.get_avg_rating() %]
618                                                         [% rating_avg_int = BLOCK %][% rating_avg | format("%.0f") %][% END %]
619                                                         <div class="br-wrapper br-theme-fontawesome-stars">
620                                                             <div class="br-widget br-readonly">
621                                                                 [% FOREACH i IN [ 1 2 3 4 5  ] %]
622                                                                     [% IF rating_avg_int == i %]
623                                                                         <a href="#" class="br-selected br-current"></a>
624                                                                     [% ELSIF rating_avg_int > i %]
625                                                                         <a href="#" class="br-selected"></a>
626                                                                     [% ELSE %]
627                                                                         <a href="#"></a>
628                                                                     [% END %]
629                                                                 [% END %]
630                                                             </div>
631                                                         </div>
632
633                                                         [% IF SEARCH_RESULT.ratings.count > 0  %]
634                                                             <span id="rating_total_[% SEARCH_RESULT.biblionumber | html %]">&nbsp;&nbsp;([% SEARCH_RESULT.ratings.count | html %] votes)</span>
635                                                         [% ELSE %]
636                                                             <br />
637                                                         [% END %]
638                                                     </div> <!-- / .results_summary -->
639                                                 [% END # / IF OpacStarRatings %]
640
641                                                 [% INCLUDE 'title-actions-menu.inc' items=SEARCH_RESULT %]
642
643                                                 </div>
644
645                                             </td>
646                                         </tr>
647                                     [% END # / FOREACH SEARCH_RESULT %]
648                                 </table>
649                             </form> <!-- / #bookbag_form -->
650
651                             <form id="hold_form" name="hold_form" method="get" action="/cgi-bin/koha/opac-reserve.pl">
652                                 <legend class="sr-only">Pages</legend>
653                                 <!-- The value will be set by holdBiblioNums() in basket.js -->
654                                 <input id="hold_form_biblios" type="hidden" name="biblionumbers" value=""/>
655                             </form>
656                         </div> <!-- / .searchresults -->
657
658                         <div id="bottom-pages">[% INCLUDE 'page-numbers.inc' %]</div>
659
660                     [% END # / IF total %]
661
662                     [%# Display "Not finding what you're looking for" for suggestion or ILL %]
663                     [% IF Koha.Preference( 'suggestion' ) == 1 && ( Koha.Preference( 'AnonSuggestions' ) == 1 || loggedinusername ) || ( Koha.Preference( 'ILLModule' ) == 1 && loggedinusername ) %]
664                         <div class="suggestion">
665                             Not finding what you're looking for?
666                             <ul>
667                                 [% IF Koha.Preference( 'suggestion' ) == 1 %]
668                                     [% IF Koha.Preference( 'AnonSuggestions' ) == 1 %]
669                                         <li>Make a <a href="/cgi-bin/koha/opac-suggestions.pl?op=add">purchase suggestion</a></li>
670                                     [% ELSIF loggedinusername %]
671                                         <li>Make a <a href="/cgi-bin/koha/opac-suggestions.pl?op=add">purchase suggestion</a></li>
672                                     [% END %]
673                                 [% END %]
674                                 [% IF Koha.Preference( 'ILLModule' ) == 1 && loggedinusername %]
675                                     <li>Make an <a href="/cgi-bin/koha/opac-illrequests.pl?op=create">Interlibrary loan request</a></li>
676                                 [% END %]
677                             </ul>
678                         </div>
679                     [% END %]
680                     </div> <!-- / #userresults -->
681                 </div> <!-- /.span10/12 -->
682             </div> <!-- / .row -->
683         </div> <!-- / .container-fluid -->
684     </div><!-- / .main -->
685
686 [% INCLUDE 'opac-bottom.inc' %]
687 [% BLOCK jsinclude %]
688     [% IF ( LibraryThingForLibrariesID ) %]
689         <script src="https://ltfl.librarything.com/forlibraries/widget.js?id=[% LibraryThingForLibrariesID | html %]&amp;systype=koha"></script>
690     [% END %]
691     [% IF ( OverDriveEnabled ) %][% Asset.js("js/overdrive.js") | $raw %][% END %]
692     [% IF ( RecordedBooksEnabled ) %][% Asset.js("js/recordedbooks.js") | $raw %][% END %]
693     [% Asset.js("js/authtoresults.js") | $raw %]
694     [% Asset.js("lib/hc-sticky.js") | $raw %]
695     [% IF ( OpacHighlightedWords ) %]
696         [% Asset.js("lib/jquery/plugins/jquery.highlight-3.js") | $raw %]
697     [% END %]
698     [% IF OpenLibraryCovers || OpenLibrarySearch %]
699         [% Asset.js("js/openlibrary.js") | $raw %]
700     [% END %]
701
702     <script>
703         [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'RequestOnOpac' ) == 1 ) %]
704             function holdMultiple() {
705                 var checkedBiblioNums = ""; // Separated by "/"
706                 var checkedCount = 0;
707                 if(document.bookbag_form.biblionumber.length > 0) {
708                     for (var i=0; i < document.bookbag_form.biblionumber.length; i++) {
709                         if (document.bookbag_form.biblionumber[i].checked) {
710                             checkedBiblioNums += (document.bookbag_form.biblionumber[i].value + "/");
711                             checkedCount++;
712                         }
713                     }
714                 }
715
716                 if (checkedCount > 0) {
717                     holdBiblioNums(checkedBiblioNums);
718                 } else {
719                     alert( __("No item was selected") );
720                 }
721             }
722
723             function holdBiblioNums(numList) {
724                 // numList: biblio numbers separated by "/"
725                 $("#hold_form_biblios").attr("value", numList);
726                 $("#hold_form").submit();
727             }
728         [% END # /IF opacuserlogin && RequestOnOpac %]
729
730         [% IF ( TagsInputEnabled && loggedinusername ) %]
731             function tagSelected() {
732                 var checkedBoxes = $(".searchresults :checkbox:checked");
733                 if ($(checkedBoxes).size() == 0) {
734                     alert( __("No item was selected") );
735                 } else {
736                     $("#tagsel_tag").hide();
737                     $(".resort").hide();
738                     $("#tagsel_form").show();
739                 }
740             }
741
742             function tagCanceled() {
743                 $("#tagsel_form").hide();
744                 $("#tagsel_tag").show();
745                 $(".resort").show();
746                 $("#tagsel_new").val("");
747                 $("#tagsel_status, .tagstatus").empty().hide();
748             }
749
750             function tagAdded() {
751                 var checkedBoxes = $(".searchresults :checkbox:checked");
752                 if ($(checkedBoxes).size() == 0) {
753                     alert( __("No item was selected") );
754                     return false;
755                 }
756
757                 var tag = $("#tagsel_new").val();
758                 if (!tag || (tag == "")) {
759                     alert(MSG_NO_TAG_SPECIFIED);
760                     return false;
761                 }
762
763                 var bibs = [];
764                 for (var i = 0; i < $(checkedBoxes).size(); i++) {
765                     var box = $(checkedBoxes).get(i);
766                     bibs[i] = $(box).val();
767                 }
768
769                 KOHA.Tags.add_multitags_button(bibs, tag);
770                 return false;
771             }
772         [% END # /IF TagsInputEnabled && loggedinusername %]
773
774
775         function enableCheckboxActions(){
776             // Enable/disable controls if checkboxes are checked
777             var checkedBoxes = $(".cb:checked");
778             var controls = $(".selections-toolbar .links a, .selections-toolbar .links input, .selections-toolbar .links select, .selections-toolbar .links label, .selections-toolbar .links button");
779             if ($(checkedBoxes).size()) {
780                 $(".selections").html(_("With selected titles: "));
781                 $(controls).removeClass("disabled");
782             } else {
783                 $(".selections").html(_("Select titles to: "));
784                 $(controls).addClass("disabled");
785             }
786         }
787
788         [% IF ( OpacHighlightedWords ) %]
789             var q_array = new Array();  // holds search terms if available
790
791             function highlightOff() {
792                 $("td").removeHighlight();
793                 $(".highlight_toggle").toggle();
794             }
795             function highlightOn() {
796                 var x;
797                 for (x in q_array) {
798                     q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
799                     q_array[x] = q_array[x].toLowerCase();
800                     var myStopwords = "[% Koha.Preference('NotHighlightedWords') | html %]".toLowerCase().split('|');
801                     if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
802                         $(".title").highlight(q_array[x]);
803                         $(".author").highlight(q_array[x]);
804                         $(".results_summary").highlight(q_array[x]);
805                     }
806                 }
807                 $(".highlight_toggle").toggle();
808             }
809         [% END # /IF OpacHighlightedWords %]
810
811         $(document).ready(function(){
812
813             $(".moretoggle").click(function(e){
814                 e.preventDefault();
815                 $(this).siblings(".collapsible-facet").toggle();
816                 $(this).siblings(".moretoggle").toggle();
817                 $(this).toggle();
818             });
819
820             [% IF ( OpacHighlightedWords ) %]
821                 $('a.title').each(function() {
822                     $(this).attr("href", $(this).attr("href") + "&query_desc=[% query_desc | uri %]");
823                 });
824             [% END %]
825
826             $(".cb").click(function(){
827                 enableCheckboxActions();
828             });
829             enableCheckboxActions();
830
831             $(".br-readonly a").on("click", function(e){
832                 e.preventDefault();
833             });
834
835             $('.resort').change(function() {
836                 $('#bookbag_form').submit();
837             });
838
839             $('#results_per_page').change(function() {
840                 $('#bookbag_form').submit();
841             });
842
843             [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
844                 [% IF Koha.Preference( 'virtualshelves' ) == 1 %]
845                     $("#addto").on("change",function(){
846                         cartList();
847                     });
848                     $(".addto").find("input:submit").click(function(){
849                         cartList();
850                         return false;
851                     });
852                 [% ELSE %]
853                     $("#addto").on("click",function(){
854                         cartList();
855                         return false;
856                     });
857                 [% END %]
858             [% END %]
859
860             function cartList(){
861                 addtoOption = $("#addto").find("option:selected");
862                 addtoval = addtoOption.val();
863                 if(addtoval == "addtolist"){
864                     var shelfnumber = addtoOption.attr("id").replace("s","");
865                     if (vShelfAdd()) {
866                         Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?selectedshelf='+shelfnumber+'&' + vShelfAdd());
867                     }
868                     return false;
869                 } else if(addtoval == "newlist"){
870                     [% IF ( loggedinusername ) %]if (vShelfAdd()) {
871                         Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?newshelf=1&' + vShelfAdd());
872                     }[% ELSE %]
873                         alert(_("You must be logged in to create or add to lists"));
874                     [% END %]
875                     return false;
876                 } else if(addtoval == "morelists"){
877                     [% IF ( loggedinusername ) %]
878                         if (vShelfAdd()) {
879                             Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?' + vShelfAdd());
880                         }
881                     [% ELSE %]
882                         alert(_("You must be logged in to create or add to lists"));
883                     [% END %]
884                     return false;
885                 }
886                 if(addtoval == "addtocart" || $("#addto").attr("class") == "addtocart"){
887                     addMultiple();
888                     return false;
889                 }
890             }
891             $("#CheckAll").on("click",function(e){
892                 e.preventDefault();
893                 $(".cb").prop("checked", true);
894                 enableCheckboxActions();
895             });
896             $("#CheckNone").on("click",function(e){
897                 e.preventDefault();
898                 $(".cb").prop("checked", false);
899                 enableCheckboxActions();
900             });
901
902             $(".hold").on("click", function(e){
903                 e.preventDefault();
904                 holdMultiple();
905             });
906
907             [% IF ( query_desc ) %]
908                 [% IF ( OpacHighlightedWords ) %]
909                     q_array = query_desc.split(" ");
910                     // ensure that we don't have "" at the end of the array, which can
911                     // break the highlighter
912                     while (q_array.length > 0 && q_array[q_array.length-1] == "") {
913                         q_array = q_array.splice(0,-1);
914                     }
915                     highlightOn();
916                     $("#highlight_toggle_on" ).hide().click(function(e) {
917                         e.preventDefault();
918                         highlightOn();
919                     });
920                     $("#highlight_toggle_off").show().click(function(e) {
921                         e.preventDefault();
922                         highlightOff();
923                     });
924                 [% END # /IF OpacHighlightedWords %]
925                 [% IF ( OverDriveEnabled ) %]
926                     var $overdrive_results = $( '<div id="overdrive-results">' + MSG_SEARCHING.format('OverDrive') + ' <img class="throbber" src="[% interface | html %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' );
927                     $( '#numresults' ) .after( $overdrive_results );
928                     //Clean querystring, first we remove CCL entities, then decode HTML entities, then swap double quotes for single quotes
929                     //as the overdrive API treats double quotes as a search term and returns extra results
930                     od_querystring = querystring.replace(/(?:^|\W)([\w-]+)(,[\w-]+)*([:=])/g,' ');
931                     od_querystring = new DOMParser().parseFromString( od_querystring, 'text/html').body.innerText;
932                     od_querystring = od_querystring.replace(/\"/g,"'");
933                     KOHA.OverDrive.Search( "[% Koha.Preference('OverDriveLibraryID') | html %]", od_querystring, 1, 0, function( data ) {
934                         if ( data.error ) {
935                             $overdrive_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('OverDrive') );
936                             return;
937                         }
938
939                         if ( data.totalItems ) {
940                             $overdrive_results.html( '<a href="/cgi-bin/koha/opac-overdrive-search.pl?q=' + encodeURIComponent( od_querystring ) + '">' + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.totalItems, 'OverDrive') + '</a>' );
941                         } else {
942                             $overdrive_results.remove();
943                         }
944                     } );
945                 [% END # /IF OverDriveEnabled %]
946                 [% IF ( RecordedBooksEnabled ) %]
947                     var $recordedbooks_results = $( '<div id="recordedbooks-results">' + MSG_SEARCHING.format('RecordedBooks') + ' <img class="throbber" src="[% interface | html %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' );
948                     $( '#numresults' ) .after( $recordedbooks_results );
949                     KOHA.RecordedBooks.search( querystring, [% OPACnumSearchResults || "null" | html %], null, function( data ) {
950                         if ( data.error ) {
951                             $recordedbooks_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('RecordedBooks')  + ': ' + data.error);
952                             return;
953                         }
954
955                         // data.total can be either 42 or "60+"
956                         if ( typeof(data.total) === 'string' && data.total.charAt(0) > 0 || typeof(data.total) === 'number' && data.total > 0 ) {
957                             $recordedbooks_results.html( '<a href="/cgi-bin/koha/opac-recordedbooks-search.pl?q=' + encodeURIComponent( querystring ) + '">' + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.total, 'RecordedBooks') + '</a>' );
958                         } else {
959                             $recordedbooks_results.remove();
960                         }
961                     } );
962                 [% END # /IF RecordedBooksEnabled %]
963                 [% IF ( OpenLibrarySearch ) %]
964                     var $openlibrary_results = $( '<div id="openlibrary-results">' + MSG_SEARCHING.format('OpenLibrary' ) + ' <img class="throbber" src="[% interface | html %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' );
965                     $( '#numresults' ) .after( $openlibrary_results );
966                     KOHA.OpenLibrary.search( querystring, null, function( data ) {
967                         if ( data.error ) {
968                             $openlibrary_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('OpenLibrary') );
969                             return;
970                         }
971
972                         if ( data.numFound > 0 ) {
973                             $openlibrary_results.html( '<a href="' + KOHA.OpenLibrary.searchUrl(querystring) + '" target="openlibrary">'  + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.numFound, 'OpenLibrary') + '</a>' );
974                         } else {
975                             $openlibrary_results.remove();
976                         }
977                     } );
978                 [% END # /IF OpenLibrarySearch %]
979             [% END # /IF query_desc %]
980
981             [% IF ( TagsInputEnabled && loggedinusername ) %]
982                 $("#tagsel_tag").show().click(function(){
983                     tagSelected();
984                     return false;
985                 });
986                 $("#tagsel_cancel").click(function(){
987                     tagCanceled();
988                     return false;
989                 });
990                 $("#tagsel_button").click(function(){
991                     tagAdded();
992                     return false;
993                 });
994
995                 $(".tag_add").click(function(){
996                     var thisid = $(this).attr("id");
997                     thisid = thisid.replace("tag_add","");
998                     $(this).addClass("hidden");
999                     $("#tagform"+thisid).show();
1000                     $("#newtag"+thisid).focus();
1001                     $("#newtag"+thisid+"_status").empty().hide();
1002                     return false;
1003                 });
1004                 $(".cancel_tag_add").click(function(){
1005                     var thisid = $(this).attr("id");
1006                     thisid = thisid.replace("cancel","");
1007                     $("#tagform"+thisid).hide();
1008                     $("#tag_add"+thisid).removeClass("hidden");
1009                     $("#newtag"+thisid).val("");
1010                     $("#newtag"+thisid+"_status").empty().hide();
1011                     return false;
1012                 });
1013                 $(".tagbutton").click(function(){
1014                     var thisid = $(this).attr("title");
1015                     var tag = $("#newtag"+thisid).val();
1016                     if (!tag || (tag == "")) {
1017                         alert(MSG_NO_TAG_SPECIFIED);
1018                         return false;
1019                     }
1020                     KOHA.Tags.add_tag_button(thisid, tag);
1021                     return false;
1022                 });
1023             [% END # /IF TagsInputEnabled && loggedinusername %]
1024
1025             [% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %]
1026             [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
1027             [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
1028             [% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %]
1029                 KOHA.coce.getURL('[% Koha.Preference('CoceHost') | html %]', '[% Koha.Preference('CoceProviders') | html %]');
1030             [% END %]
1031
1032             [% IF ( DidYouMean ) %]
1033                 $("#didyoumean").load("/cgi-bin/koha/svc/suggestion?render=stub&q=[% querystring |uri %]",
1034                     function() {
1035                         $(this).addClass("dym-loaded");
1036                     });
1037             [% END %]
1038
1039             $("input.newtag").on('keydown', function(e){
1040                 if (e.keyCode == 13) { e.preventDefault(); }
1041             });
1042
1043             Sticky = $("#floating");
1044             Sticky.hcSticky({
1045                 stickTo: ".searchresults",
1046                 stickyClass: "floating"
1047             });
1048
1049         });
1050     </script>
1051 [% END %]