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