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