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