]> git.koha-community.org Git - koha.git/blob - koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt
Bug 11648 - Use word item instead of copy - opac bootstrap
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-results.tt
1 [% USE Koha %]
2 [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnList ) %]
3 [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnList ) %]
4
5 [% INCLUDE 'doc-head-open.inc' %]
6 [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog ›
7 [% IF ( searchdesc ) %]
8     Results of search [% IF ( query_desc ) %]for '[% query_desc | html%]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc | html %]'[% END %]
9 [% ELSE %]
10     You did not specify any search criteria.
11 [% END %]
12 [% INCLUDE 'doc-head-close.inc' %]
13 [% IF ( OpacStarRatings == 'all' || Koha.Preference('Babeltheque') ) %]
14     [% BLOCK cssinclude %]
15         <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/jquery.rating.css" />
16     [% END %]
17 [% END %]
18
19 <link rel="alternate" type="application/rss+xml" title="[% LibraryName |html %] Search RSS feed" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |uri %][% limit_cgi |uri %]&amp;count=[% countrss |uri %]&amp;sort_by=acqdate_dsc&amp;format=rss2" />
20 </head>
21
22 <body id="results" class="scrollto">
23 [% INCLUDE 'masthead.inc' %]
24
25     <div class="main">
26         <ul class="breadcrumb">
27             <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
28             <li>
29                 [% IF ( searchdesc ) %]
30                     <a href="#">Results of search [% IF ( query_desc ) %]for '[% query_desc | html%]'[% END %][% IF ( limit_desc ) %]&nbsp;with limit(s):&nbsp;'[% limit_desc | html %]'[% END %]</a>
31                 [% ELSE %]
32                     <a href="#">You did not specify any search criteria</a>
33                 [% END %]
34             </li>
35         </ul>
36
37         [% UNLESS ( total ) %]
38             <div class="container-fluid maincontent">
39                 <div class="row-fluid">
40                     <div class="span12">
41                         <strong>No results found!</strong>
42                         <p>
43                             [% IF ( searchdesc ) %]
44                                 No results found for that in [% LibraryName %] catalog. <a href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi | html | url %][% limit_cgi | html | url %]&amp;format=rss2" class="rsssearchlink"><img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png" alt="Subscribe to this search" title="Subscribe to this search" border="0" class="rsssearchicon"/></a>
45                             [% ELSE %]
46                                 You did not specify any search criteria.
47                             [% END %]
48                         </p>
49                         [% IF ( OPACNoResultsFound ) %]
50                             <div id="noresultsfound">
51                                 [% OPACNoResultsFound %]
52                             </div>
53                         [% END %]
54                     </div> <!-- / .span12 -->
55                 </div> <!-- / .row-fluid -->
56             </div> <!-- / .container-fluid -->
57         [% END # / UNLESS searchdesc %]
58
59         <div id="maincontent" class="container-fluid">
60             <div class="row-fluid">
61                 [% IF ( opacfacets && total ) %]
62                     <div class="span2">
63                         <div id="facetcontainer">
64                             <!-- FACETS START -->
65                             [% INCLUDE 'opac-facets.inc' %]
66                             <!-- FACETS END -->
67                         </div>
68                     </div>
69                 [% END %]
70
71                 [% IF ( opacfacets && total ) %]<div class="span10 maincontent">[% ELSE %]<div class="span12 maincontent">[% END %]
72
73                 [% IF ( searchdesc ) %]
74                     <p id="numresults">
75                     [% IF ( total ) %]<strong>Your search returned [% total |html %] results.</strong>
76                         [% IF ( related ) %]
77                             (related searches:
78                                 [% FOREACH relate IN related %]
79                                     [% relate.related_search %]
80                                 [% END %]
81                             ).
82                         [% END %]
83                         <a href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html |url %][% limit_cgi |html | url %]&amp;count=[% countrss |html %]&amp;sort_by=acqdate_dsc&amp;format=rss2" class="rsssearchlink"><img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png" alt="Subscribe to this search" title="Subscribe to this search" class="rsssearchicon"/></a>
84                     [% END # / IF total %]
85                     </p>
86                 [% END # / IF searchdesc %]
87
88                 <div id="userresults">
89                     [% IF ( DidYouMean ) %]
90                         <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>
91                     [% END %]
92
93                     <div id="top-pages">[% INCLUDE 'page-numbers.inc' %]</div>
94
95                     [% IF ( koha_spsuggest ) %]
96                         Did you mean:
97                         <ul style="list-style: none;">
98                             [% FOREACH SPELL_SUGGES IN SPELL_SUGGEST %]
99                             <li>
100                                 <a href="/cgi-bin/koha/opac-search.pl?q=[% SPELL_SUGGES.spsuggestion %]">[% SPELL_SUGGES.spsuggestion %]</a>
101                             </li>
102                             [% END %]
103                         </ul>
104                     [% END # / IF koha_spsuggest%]
105
106                     [% IF ( query_error ) %]
107                         <div class="dialog alert">
108                             <h4>Error:</h4>
109                             [% query_error %]
110                         </div>
111                     [% END %]
112
113                     <!-- Search Results Table -->
114                     [% IF ( total ) %]
115
116                         <div class="searchresults">
117                             <form action="/cgi-bin/koha/opac-search.pl" method="get" name="bookbag_form" id="bookbag_form" class="checkboxed">
118                                 [% IF ( searchdesc ) %]
119                                     [% FOREACH QUERY_INPUT IN QUERY_INPUTS %]
120                                         <input type="hidden" name="[% QUERY_INPUT.input_name |html %]" value="[% QUERY_INPUT.input_value |html %]"/>
121                                     [% END %]
122                                     [% FOREACH LIMIT_INPUT IN LIMIT_INPUTS %]
123                                         <input type="hidden" name="[% LIMIT_INPUT.input_name |html %]" value="[% LIMIT_INPUT.input_value |html %]"/>
124                                     [% END %]
125                                 [% END # IF /searchdesc %]
126
127                                 <div id="toolbar" class="toolbar clearfix">
128                                     [% IF ( OpacHighlightedWords ) %]
129                                         <div class="highlight_controls">
130                                             <a href="#" class="highlight_toggle" id="highlight_toggle_off">Unhighlight</a>
131                                             <a href="#" class="highlight_toggle" id="highlight_toggle_on">Highlight</a>
132                                         </div>
133                                     [% END %]
134                                     <div class="sort_by pull-right">
135                                         <select id="sort_by" class="resort" name="sort_by"> [% INCLUDE 'resort_form.inc' %] </select>
136                                         <input type="submit" class="btn btn-small clearfix" id="sortsubmit" value="Go" />
137                                     </div>
138                                 </div> <!-- / #toolbar -->
139
140                                 <div id="selections-toolbar" class="toolbar">
141                                     <!-- checkall, clearall are now needed for placehold -->
142                                     <span class="checkall"></span>
143                                     <span class="clearall"></span> <span class="sep">|</span>
144
145                                         <span class="links">
146                                             [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
147                                                 <span class="addto"></span>
148                                             [% END %]
149                                             <span id="placehold"><!-- input class="submit" type="submit" value="Place Hold"/ --></span>
150
151                                             [% IF ( TagsInputEnabled && loggedinusername ) %]
152                                                 <span id="tagsel_span">
153                                                     <input id="tagsel_tag" class="disabled" type="submit" value="Tag"/>
154                                                 </span>
155                                                 <div id="tagsel_form" style="display:none">
156                                                     <label for="tagsel_new">New tag:</label>
157                                                     <input name="tagsel_new" id="tagsel_new" maxlength="100" />
158                                                     <input id="tagsel_button" name="tagsel_button" class="tagsel_button btn btn-small" title="Add" type="submit" value="Add" />
159                                                     <a href="#" id="tagsel_cancel">(done)</a>
160                                                 </div>
161                                                 <div id="tagsel_status" class="tagsel_tatus" style="display:none;">
162                                                     Tag status here.
163                                                 </div>
164                                             [% END %]
165                                         </span> <!-- / .links -->
166                                 </div> <!-- / #selections-toolbar -->
167
168                                 <!-- TABLE RESULTS START -->
169                                 <table class="table table-striped">
170
171                                     <!-- Actual Search Results -->
172                                     [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
173                                         <tr>
174                                             [% # Cell 1: Checkbox %]
175                                             <td class="select selectcol">
176                                                 [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
177                                                     <input type="checkbox" class="cb" id="bib[% SEARCH_RESULT.biblionumber %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber %]" /> <label for="bib[% SEARCH_RESULT.biblionumber %]"></label>
178                                                 [% ELSE %]
179                                                     [% IF Koha.Preference( 'virtualshelves' ) == 1 %]
180                                                         <input type="checkbox" class="cb" id="bib[% SEARCH_RESULT.biblionumber %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber %]" /> <label for="bib[% SEARCH_RESULT.biblionumber %]"></label>
181                                                     [% ELSE %]
182                                                         [% IF Koha.Preference( 'RequestOnOpac' ) == 1 %]
183                                                             [% UNLESS ( SEARCH_RESULT.norequests ) %]
184                                                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]<input type="checkbox" class="cb" id="bib[% SEARCH_RESULT.biblionumber %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber %]" /> <label for="bib[% SEARCH_RESULT.biblionumber %]"></label>
185                                                                 [% END %]
186                                                             [% END %]
187                                                         [% END # IF RequestOnOpac %]
188                                                     [% END # IF virtualshelves %]
189                                                 [% END # IF opacbookbag%]
190                                             </td>
191                                             [% # Cell 2: Show result number if OpacHiddenItems is empty %]
192                                             <td class="select selectcol">
193                                                 [% UNLESS suppress_result_number %]
194                                                     [% SEARCH_RESULT.result_number %].
195                                                 [% END %]
196                                             </td>
197
198                                             [% IF ( !item_level_itypes && !noItemTypeImages ) %]
199                                                 [% # Cell 3: Show item type image %]
200                                                 <td class="itypecol">
201                                                     [% IF ( SEARCH_RESULT.imageurl ) %]
202                                                         <img src="[% SEARCH_RESULT.imageurl %]" title="[% SEARCH_RESULT.description %]" alt="[% SEARCH_RESULT.description %]" />
203                                                     [% END %]
204                                                     [% IF ( SEARCH_RESULT.score_avg ) %]
205                                                         <img src="[% themelang %]/../images/bonus.png" title="bonus" style="max-height: 35px;"/>
206                                                     [% END %]
207                                                 </td>
208                                             [% END %]
209
210                                             [% IF ( AuthorisedValueImages ) %]
211                                                 [% # Cell 4: Show Authorized value image %]
212                                                 <td class="authvalcol">
213                                                     [% FOREACH authorised_value_image IN SEARCH_RESULT.authorised_value_images %]
214                                                         [% IF ( authorised_value_image.imageurl ) %]
215                                                             <img src="[% authorised_value_image.imageurl %]" alt="[% authorised_value_image.label %]" title="[% authorised_value_image.label %]">
216                                                         [% END %]
217                                                     [% END %]
218                                                 </td>
219                                             [% END %]
220
221                                             [% # Cell 5: Search result details and controls %]
222                                             <td class="bibliocol">
223                                                 <div class="coverimages">
224                                                     <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">
225                                                         [% IF ( OPACLocalCoverImages ) %]
226                                                             <span title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.biblionumber %]" id="local-thumbnail[% loop.count %]"></span>
227                                                         [% END %]
228                                                         [% IF ( OPACAmazonCoverImages ) %]
229                                                             [% IF ( SEARCH_RESULT.normalized_isbn ) %]
230                                                                 <span title="[% SEARCH_RESULT.biblionumber %]" id="amazon-thumbnail[% loop.count %]"><img src="http://images.amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="item-thumbnail" /></span>
231                                                             [% ELSE %]
232                                                                 <span class="no-image">No cover image available</span>
233                                                             [% END %]
234                                                         [% END %]
235
236                                                         [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
237                                                             [% IF SEARCH_RESULT.normalized_isbn %]
238                                                                     [% IF ( using_https ) %]
239                                                                         <span title="[% SEARCH_RESULT.biblionumber %]" id="syndetics-thumbnail[% loop.count %]"><img src="https://secure.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% SEARCH_RESULT.normalized_upc %]&amp;oclc=[% SEARCH_RESULT.normalized_oclc %]" alt="" class="item-thumbnail" /></span>
240                                                                     [% ELSE %]
241                                                                         <span title="[% SEARCH_RESULT.biblionumber %]" id="syndetics-thumbnail[% loop.count %]"><img src="http://www.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% SEARCH_RESULT.normalized_upc %]&amp;oclc=[% SEARCH_RESULT.normalized_oclc %]" alt="" class="item-thumbnail" /></span>
242                                                                     [% END %]
243                                                             [% ELSE %]
244                                                                 <span class="no-image">No cover image available</span>
245                                                             [% END %]
246                                                         [% END %]
247
248                                                         [% IF ( GoogleJackets ) %]
249                                                             [% IF ( SEARCH_RESULT.normalized_isbn ) %]
250                                                                 <span style="block" title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></span>
251                                                             [% ELSE %]
252                                                                 <span class="no-image">No cover image available</span>
253                                                             [% END %]
254                                                         [% END %]
255
256                                                         [% IF OpenLibraryCovers %]
257                                                             [% IF SEARCH_RESULT.normalized_isbn %]
258                                                                 <span style="block" title="[% SEARCH_RESULT.biblionumber %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="openlibrary-thumbnail[% loop.count %]"></span>
259                                                             [% ELSE %]
260                                                                 <span class="no-image">No cover image available</span>
261                                                             [% END %]
262                                                         [% END %]
263                                                     </a>
264
265                                                     [% IF ( BakerTaylorEnabled ) %]
266                                                         [% IF ( SEARCH_RESULT.normalized_isbn ) %]
267                                                             <a href="https://[% BakerTaylorBookstoreURL |html %][% SEARCH_RESULT.normalized_isbn %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% SEARCH_RESULT.normalized_isbn %]" /></a>
268                                                         [% ELSE %]
269                                                             <span class="no-image">No cover image available</span>
270                                                         [% END %]
271                                                     [% END %]
272
273                                                     [% IF ( IDreamBooksResults && SEARCH_RESULT.normalized_isbn ) %]
274                                                         <div class="idbresult" style="display: none;">
275                                                             [% IF ( IDreamBooksReviews ) %]
276                                                                 <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]#idb_critic_reviews">
277                                                             [% ELSE %]
278                                                                 <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">
279                                                             [% END %]
280                                                             [% SEARCH_RESULT.normalized_isbn %]</a>
281                                                         </div>
282                                                     [% END %]
283                                                 </div>
284                                                 [% IF ( COinSinOPACResults && SEARCH_RESULT.coins ) %]
285                                                     <!-- COinS / Openurl -->
286                                                     <span class="Z3988" title="[% SEARCH_RESULT.coins %]"></span>
287                                                 [% END %]
288
289                                                 [% IF ( OPACXSLTResultsDisplay ) %]
290                                                     [% SEARCH_RESULT.XSLTResultsRecord %]
291                                                 [% ELSE %]
292                                                     [% IF ( BiblioDefaultViewmarc ) %]
293                                                         <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]" title="View details for this title">
294                                                     [% ELSE %]
295                                                         [% IF ( BiblioDefaultViewisbd ) %]
296                                                             <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]" title="View details for this title">
297                                                         [% ELSE %]
298                                                             <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]" title="View details for this title">
299                                                         [% END %]
300                                                     [% END %]
301
302                                                     [% IF ( SEARCH_RESULT.title ) %]
303                                                         [% SEARCH_RESULT.title |html %]
304                                                     [% ELSE %]
305                                                         No title
306                                                     [% END %]
307
308                                                     [% FOREACH subtitl IN SEARCH_RESULT.subtitle %]
309                                                         , [% subtitl.subfield|html %]
310                                                     [% END %]</a>
311
312                                                     [% IF ( SEARCH_RESULT.author ) %]
313                                                         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 %]</a>
314                                                     [% ELSE %]
315                                                         &nbsp;
316                                                     [% END %]
317
318                                                     <span class="results_summary publisher">
319                                                         <span class="label">Publication:</span>
320                                                             [% IF ( SEARCH_RESULT.place ) %][% SEARCH_RESULT.place %] [% END %]
321                                                             [% IF ( SEARCH_RESULT.publishercode ) %][% SEARCH_RESULT.publishercode|html %][% END %]
322                                                             [% IF ( SEARCH_RESULT.publicationyear ) %]
323                                                                 [% SEARCH_RESULT.publicationyear %]
324                                                             [% ELSE %]
325                                                                 [% IF ( SEARCH_RESULT.copyrightdate ) %]
326                                                                     [% SEARCH_RESULT.copyrightdate %]
327                                                                 [% END %]
328                                                             [% END %]
329                                                             [% IF ( SEARCH_RESULT.pages ) %]. [% SEARCH_RESULT.pages %][% END %]
330                                                             [% IF ( SEARCH_RESULT.notes ) %], [% SEARCH_RESULT.notes|html %][% END %]
331                                                             [% IF ( SEARCH_RESULT.size ) %] [% SEARCH_RESULT.size %][% END %]
332                                                             [% IF ( SEARCH_RESULT.timestamp ) %] <i>(modified on [% SEARCH_RESULT.timestamp %])</i>[% END %]
333                                                     </span>
334
335                                                     [% IF ( SEARCH_RESULT.summary ) %]
336                                                         <span class="result_summary">
337                                                             [% SEARCH_RESULT.summary %]
338                                                         </span>
339                                                     [% END %]
340
341                                                     [% IF ( SEARCH_RESULT.copyrightdate ) %]
342                                                         <span class="results_summary date">
343                                                             <span class="label">Date:</span>
344                                                             [% SEARCH_RESULT.copyrightdate %]
345                                                         </span>
346                                                     [% END %]
347
348                                                     <span class="results_summary">
349                                                         <span class="label">Availability:</span>
350                                                             [% IF ( SEARCH_RESULT.available_items_loop.size() ) %]
351                                                                 <span class="available"><strong>Items available:</strong>
352                                                                     [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
353                                                                         [% IF available_items_loo.this_branch %]
354                                                                             <span class="highlight-row-results">
355                                                                         [% ELSE %]
356                                                                             <span>
357                                                                         [% END %]
358
359                                                                         [% IF ( singleBranchMode ) %]
360                                                                             [% available_items_loo.location %]
361                                                                         [% ELSE %]
362                                                                             [% available_items_loo.branchname %]
363                                                                         [% END %]
364
365                                                                         [% IF ( OPACItemsResultsDisplay ) %]
366                                                                             [% UNLESS ( singleBranchMode ) %][% available_items_loo.location %][% END %]
367                                                                             [% IF ( available_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/opac-search.pl?q=callnum:[% available_items_loo.itemcallnumber |url %]">[% available_items_loo.itemcallnumber %]</a>][% END %]
368                                                                         [% END %]
369                                                                         ([% available_items_loo.count %]),
370                                                                         </span>
371                                                                     [% END # / FOREACH available_items_loo %]
372                                                                 </span>
373                                                             [% ELSE %]
374                                                                 [% IF ( SEARCH_RESULT.ALTERNATEHOLDINGS ) %]
375                                                                     [% FOREACH ALTERNATEHOLDING IN SEARCH_RESULT.ALTERNATEHOLDINGS %]
376                                                                         &nbsp;<span id="alternateholdings">[% ALTERNATEHOLDING.holding %]</span>,
377                                                                     [% END %]
378                                                                 [% ELSE %]
379                                                                     <span class="unavailable">No items available:</span>
380                                                                 [% END %]
381                                                             [% END # / IF SEARCH_RESULT.available_items_loop.size %]
382
383                                                             <span class="unavailable">
384                                                                 [% IF ( SEARCH_RESULT.onloancount ) %] Checked out ([% SEARCH_RESULT.onloancount %]), [% END %]
385                                                                 [% IF ( SEARCH_RESULT.withdrawncount ) %] Withdrawn ([% SEARCH_RESULT.withdrawncount %]), [% END %]
386                                                                 [% UNLESS ( SEARCH_RESULT.hidelostitems ) %][% IF ( SEARCH_RESULT.itemlostcount ) %] Lost ([% SEARCH_RESULT.itemlostcount %]),[% END %][% END %]
387                                                                 [% IF ( SEARCH_RESULT.damagedcount ) %] Damaged ([% SEARCH_RESULT.damagedcount %]),[% END %]
388                                                                 [% IF ( SEARCH_RESULT.orderedcount ) %] On order ([% SEARCH_RESULT.orderedcount %]),[% END %]
389                                                                 [% IF ( SEARCH_RESULT.onholdcount ) %] On hold ([% SEARCH_RESULT.onholdcount %]),[% END %]
390                                                                 [% IF ( SEARCH_RESULT.intransitcount ) %] In transit ([% SEARCH_RESULT.intransitcount %]),[% END %]
391                                                             </span>
392                                                     </span> <!-- / .results_summary -->
393                                                 [% END # / IF OPACXSLTResultsDisplay %]
394
395                                                 [% IF ( SEARCH_RESULT.score_avg ) %]
396                                                     <div class="results_summary">
397                                                         [% FOREACH i  IN [ 1 2 3 4 5  ] %]
398                                                             [% IF ( SEARCH_RESULT.score_int >= i ) %]
399                                                                 <div class="star-rating rater-[% i %] star star-rating-applied star-rating-readonly star-rating-on"><a title="[% i %]">[% i %]</a></div>
400                                                             [% ELSE   %]
401                                                                 <div class="star-rating rater-[% i %] star star-rating-applied star-rating-readonly"><a title="[% i %]">[% i %]</a></div>
402                                                             [% END %]
403                                                         [% END %]
404                                                         <span id="babeltheque-rating_total_[% SEARCH_RESULT.biblionumber %]">&nbsp;&nbsp; [% SEARCH_RESULT.score_avg %] / 5 (on [% SEARCH_RESULT.num_scores %] rates)</span>
405
406                                                         [% IF ( SEARCH_RESULT.num_critics ) %]
407                                                             <span class="social_data">[% SEARCH_RESULT.num_critics %] Internet user critics</span>
408                                                         [% END %]
409                                                         [% IF ( SEARCH_RESULT.num_critics_pro ) %]
410                                                             <span class="social_data">[% SEARCH_RESULT.num_critics_pro %] Professional critics</span>
411                                                         [% END %]
412                                                         [% IF ( SEARCH_RESULT.num_videos ) %]
413                                                             <span class="social_data">[% SEARCH_RESULT.num_videos %] Video extracts</span>
414                                                         [% END %]
415                                                         [% IF ( SEARCH_RESULT.num_quotations ) %]
416                                                             <span class="social_data">[% SEARCH_RESULT.num_quotations %] Quotations</span>
417                                                         [% END %]
418                                                     </div> <!-- / .results_summary -->
419                                                 [% END # / IF SEARCH_RESULT.score_avg %]
420
421                                                 [% IF ( LibraryThingForLibrariesID ) %]
422                                                     <div class="ltfl_reviews"></div>
423                                                 [% END %]
424
425                                                 [% IF ( TagsShowEnabled && SEARCH_RESULT.TagLoop.size ) %]
426                                                     <div class="results_summary tags">
427                                                         <span class="label">Tags:</span>
428                                                         <ul>
429                                                             [% FOREACH TagLoo IN SEARCH_RESULT.TagLoop %]
430                                                                 <li>
431                                                                     <a href="/cgi-bin/koha/opac-search.pl?tag=[% TagLoo.term |url %]&amp;q=[% TagLoo.term |url %]">[% TagLoo.term %]</a>
432                                                                     <span class="weight">([% TagLoo.weight_total %])</span>
433                                                                 </li>
434                                                             [% END %]
435                                                         </ul>
436                                                     </div>
437                                                 [% END %]
438
439                                                 [% IF ( SEARCH_RESULT.searchhighlightblob ) %]
440                                                     <span class="results_summary">
441                                                         <span class="label">Match:</span>
442                                                         [% SEARCH_RESULT.searchhighlightblob %]
443                                                     </span>
444                                                 [% END %]
445
446                                                 [% IF ( OpacStarRatings == 'all' ) %]
447                                                     <div class="results_summary ratings">
448                                                         [% FOREACH i  IN [ 1 2 3 4 5  ] %]
449                                                             [% IF ( SEARCH_RESULT.rating_avg == i ) %]
450                                                                 <input class="star" type="radio"  name="rating-[% SEARCH_RESULT.biblionumber %]" value="[% i %]" checked="checked" disabled="disabled"   />
451                                                             [% ELSE   %]
452                                                                 <input class="star" type="radio"  name="rating-[% SEARCH_RESULT.biblionumber %]" value="[% i %]" disabled="disabled"   />
453                                                             [% END %]
454                                                         [% END %]
455
456                                                         <input type="hidden" name="biblionumber"  value="[% SEARCH_RESULT.biblionumber %]" />
457                                                         <input type="hidden" name="loggedinuser"  value="[% loggedinuser %]" />
458
459                                                         [% IF (  SEARCH_RESULT.rating_total ) > 0  %]
460                                                             <span id="rating_total_[% SEARCH_RESULT.biblionumber %]">&nbsp;&nbsp;([% SEARCH_RESULT.rating_total %] votes)</span>
461                                                         [% ELSE %]
462                                                             <br />
463                                                         [% END %]
464                                                     </div> <!-- / .results_summary -->
465                                                 [% END # / IF OpacStarRatings %]
466
467                                                 <div class="actions-menu">
468                                                         [% IF Koha.Preference( 'RequestOnOpac' ) == 1 %]
469                                                             [% UNLESS ( SEARCH_RESULT.norequests ) %]
470                                                                 [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && AllowOnShelfHolds ) %]
471                                                                     <span class="actions"><a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Place hold</a></span><!-- add back when available 0 holds in queue-->
472                                                                 [% ELSE %]
473                                                                     [% IF ( SEARCH_RESULT.itemsissued ) %]
474                                                                         <a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Place hold</a><!-- add back when available 0 holds in queue-->
475                                                                     [% END %]
476                                                                 [% END # / IF opacuserlogin && AllowOnShelfHolds %]
477                                                             [% END # UNLESS SEARCH_RESULT.norequests %]
478                                                         [% END # IF RequestOnOpac %]
479
480                                                         [% IF ( TagsInputEnabled ) %]
481                                                             [% IF ( loggedinusername ) %]
482                                                                 <span class="actions"><a class="tag_add" id="tag_add[% SEARCH_RESULT.biblionumber %]" href="#">Add tag</a></span>
483                                                                 <div id="tagform[% SEARCH_RESULT.biblionumber %]" class="tag_results_input" style="display:none;">
484                                                                         <label for="newtag[% SEARCH_RESULT.biblionumber %]">New tag(s), separated by a comma:</label>
485                                                                         <input type="text" name="newtag[% SEARCH_RESULT.biblionumber %]" id="newtag[% SEARCH_RESULT.biblionumber %]" maxlength="100" />
486                                                                         <input name="tagbutton" class="btn btn-small tagbutton" title="[% SEARCH_RESULT.biblionumber %]" type="submit" value="Add" />
487                                                                         <a class="cancel_tag_add" id="cancel[% SEARCH_RESULT.biblionumber %]" href="#">(done)</a>
488                                                                 </div>
489                                                                 <span id="newtag[% SEARCH_RESULT.biblionumber %]_status" class="tagstatus" style="display:none;">
490                                                                     Tag status here.
491                                                                 </span>
492                                                             [% ELSIF ( loop.first ) %]
493                                                                 <span class="actions"><span id="login4tags">Log in to add tags.</span></span>
494                                                             [% END # IF loggedinusername %]
495                                                         [% END # if TagsInputEnabled %]
496
497                                                         [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && loggedinusername && ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
498                                                             <span class="actions"><a class="addtoshelf" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]'); return false;">Save to Lists</a></span>
499                                                         [% END %]
500
501                                                         [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
502                                                             [% IF ( SEARCH_RESULT.incart ) %]
503                                                                 <span class="actions"><a class="addtocart cart[% SEARCH_RESULT.biblionumber %]" href="#" onclick="addRecord('[% SEARCH_RESULT.biblionumber %]'); return false;">In your cart</a> <a class="cartRemove cartR[% SEARCH_RESULT.biblionumber %]" href="#" onclick="delSingleRecord('[% SEARCH_RESULT.biblionumber %]'); return false;">(remove)</a></span>
504                                                             [% ELSE %]
505                                                                 <span class="actions"><a class="addtocart cart[% SEARCH_RESULT.biblionumber %]" href="#" onclick="addRecord('[% SEARCH_RESULT.biblionumber %]'); return false;">Add to cart</a> <a style="display:none;" class="cartRemove cartR[% SEARCH_RESULT.biblionumber %]" href="#" onclick="delSingleRecord('[% SEARCH_RESULT.biblionumber %]'); return false;">(remove)</a></span>
506                                                             [% END %]
507                                                         [% END # / IF opacbookbag %]
508                                                 </div>
509                                             </td>
510                                         </tr>
511                                     [% END # / FOREACH SEARCH_RESULT %]
512                                 </table>
513                             </form> <!-- / #bookbag_form -->
514
515                             <form id="hold_form" name="hold_form" method="get" action="/cgi-bin/koha/opac-reserve.pl">
516                                 <!-- The value will be set by holdBiblioNums() in basket.js -->
517                                 <input id="hold_form_biblios" type="hidden" name="biblionumbers" value=""/>
518                             </form>
519                         </div> <!-- / .searchresults -->
520
521                         <div id="bottom-pages">[% INCLUDE 'page-numbers.inc' %]</div>
522
523                     [% END # / IF total %]
524
525                     [% IF Koha.Preference( 'suggestion' ) == 1 %]
526                         [% IF Koha.Preference( 'AnonSuggestions' ) == 1 %]
527                             <div class="suggestion">Not finding what you're looking for?<br />  Make a <a href="/cgi-bin/koha/opac-suggestions.pl?op=add">purchase suggestion</a></div>
528                         [% ELSE %]
529                             [% IF ( loggedinusername ) %]
530                                 <div class="suggestion">
531                                     Not finding what you're looking for?<br />  Make a <a href="/cgi-bin/koha/opac-suggestions.pl?op=add">purchase suggestion</a>
532                                 </div>
533                             [% END %]
534                         [% END %]
535                     [% END %]
536                     </div> <!-- / #userresults -->
537                 </div> <!-- /.span10/12 -->
538             </div> <!-- / .row-fluid -->
539         </div> <!-- / .container-fluid -->
540     </div><!-- / .main -->
541
542 [% INCLUDE 'opac-bottom.inc' %]
543 [% BLOCK jsinclude %]
544 [% IF ( LibraryThingForLibrariesID ) %]
545     [% IF ( using_https ) %]
546         <script src="https://ltfl.librarything.com/forlibraries/widget.js?id=[% LibraryThingForLibrariesID %]&amp;systype=koha" type="text/javascript"></script>
547     [% ELSE %]
548         <script src="http://ltfl.librarything.com/forlibraries/widget.js?id=[% LibraryThingForLibrariesID %]&amp;systype=koha" type="text/javascript"></script>
549     [% END %]
550 [% END %]
551 [% IF ( OpacStarRatings == 'all' || Koha.Preference('Babeltheque') ) %]<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.rating.js"></script>[% END %]
552 [% IF ( OverDriveEnabled ) %]<script type="text/javascript" src="[% interface %]/[% theme %]/js/overdrive.js"></script>[% END %]
553 <script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
554 [% IF ( OpacHighlightedWords ) %]<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.highlight-3.js"></script>
555 [% END %]<script type="text/javascript">
556 //<![CDATA[
557 [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'RequestOnOpac' ) == 1 ) %]
558 function holdMultiple() {
559     var checkedBiblioNums = ""; // Separated by "/"
560     var checkedCount = 0;
561     if(document.bookbag_form.biblionumber.length > 0) {
562         for (var i=0; i < document.bookbag_form.biblionumber.length; i++) {
563             if (document.bookbag_form.biblionumber[i].checked) {
564                 checkedBiblioNums += (document.bookbag_form.biblionumber[i].value + "/");
565                 checkedCount++;
566             }
567         }
568     }
569
570     if (checkedCount > 0) {
571         holdBiblioNums(checkedBiblioNums);
572     } else {
573         alert(MSG_NO_RECORD_SELECTED);
574     }
575 }
576
577 function holdBiblioNums(numList) {
578     // numList: biblio numbers separated by "/"
579     $("#hold_form_biblios").attr("value", numList);
580     $("#hold_form").submit();
581 }[% END %]
582
583 [% IF ( TagsInputEnabled && loggedinusername ) %]
584 function tagSelected() {
585     var checkedBoxes = $(".searchresults :checkbox:checked");
586     if ($(checkedBoxes).size() == 0) {
587         alert(MSG_NO_RECORD_SELECTED);
588     } else {
589         $("#tagsel_tag").hide();
590         $(".resort").hide();
591         $("#tagsel_form").show();
592     }
593 }
594
595 function tagCanceled() {
596     $("#tagsel_form").hide();
597     $("#tagsel_tag").show();
598     $(".resort").show();
599     $("#tagsel_new").val("");
600     $("#tagsel_status, .tagstatus").empty().hide();
601 }
602
603 function tagAdded() {
604     var checkedBoxes = $(".searchresults :checkbox:checked");
605     if ($(checkedBoxes).size() == 0) {
606         alert(MSG_NO_RECORD_SELECTED);
607         return false;
608     }
609
610     var tag = $("#tagsel_new").val();
611     if (!tag || (tag == "")) {
612         alert(MSG_NO_TAG_SPECIFIED);
613         return false;
614     }
615
616     var bibs = [];
617     for (var i = 0; i < $(checkedBoxes).size(); i++) {
618         var box = $(checkedBoxes).get(i);
619         bibs[i] = $(box).val();
620     }
621
622     KOHA.Tags.add_multitags_button(bibs, tag);
623     return false;
624 }[% END %]
625
626
627 function enableCheckboxActions(){
628     // Enable/disable controls if checkboxes are checked
629     var checkedBoxes = $(".checkboxed input:checkbox:checked");
630     var controls = $("#selections-toolbar .links a, #selections-toolbar .links input, #selections-toolbar .links select, , #selections-toolbar .links label")
631     if ($(checkedBoxes).size()) {
632       $("#selections").html(_("With selected titles: "));
633       $(controls).removeClass("disabled");
634     } else {
635       $("#selections").html(_("Select titles to: "));
636       $(controls).addClass("disabled");
637     }
638 }
639
640 [% IF ( OpacHighlightedWords ) %]
641 var q_array = new Array();  // holds search terms if available
642
643 function highlightOff() {
644     $("td").removeHighlight();
645     $(".highlight_toggle").toggle();
646 }
647 function highlightOn() {
648     var x;
649     for (x in q_array) {
650         q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
651         if ( q_array[x].length > 0 ) {
652             $(".title").highlight(q_array[x]);
653             $(".author").highlight(q_array[x]);
654             $(".results_summary").highlight(q_array[x]);
655         }
656     }
657     $(".highlight_toggle").toggle();
658 }
659 [% END %]
660 $(document).ready(function(){
661     [% IF ( OpacHighlightedWords ) %]
662         $('a.title').each(function() {
663             $(this).attr("href", $(this).attr("href") + "&query_desc=[% query_desc | uri %]");
664         });
665     [% END %]
666
667     $(".cb").click(function(){
668       enableCheckboxActions();
669     });
670     enableCheckboxActions();
671
672     [% IF ( IDreamBooksResults ) %]
673         $('.idbresult').each(function() {
674             var isbn = $(this).children('a').text().replace(/\s*/,'');
675             var element = this;
676
677             if ($.browser.msie && parseInt($.browser.version, 10) >= 8 && window.XDomainRequest) {
678             // Use Microsoft XDR for IE version 8 or above
679                 var xdr = new XDomainRequest();
680                 xdr.open("get", "http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e");
681                 xdr.onload = function() {
682                     json = 'json = '+xdr.responseText; // the string now looks like..  json = { ... };
683                     eval(json); // json is now a regular JSON object
684                     if(json.total_results > 0 && json.book.rating > 0){
685                         $(element).children('a').html("<img src='"+json.book.to_read_or_not_small+"' alt='"+json.book.title+" by "+json.book.author+"' title='Rating based on reviews of "+json.book.title+"'>"+json.book.rating+"%");
686                         $(element).show();
687                     } else {
688                         $(element).remove();
689                     }
690                 }
691                 xdr.send();
692             } else {
693                 $.getJSON("http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){
694                     if(json.total_results > 0 && json.book.rating > 0){
695                         $(element).children('a').html("<img src='"+json.book.to_read_or_not_small+"' alt='"+json.book.title+" by "+json.book.author+"' title='Rating based on reviews of "+json.book.title+"'>"+json.book.rating+"%");
696                         $(element).show();
697                     } else {
698                         $(element).remove();
699                     }
700                 });
701             }
702         });
703     [% END %]
704
705     var param1 = "";
706     [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) || loggedinusername ) %]
707     param1 += "<span id=\"selections\">"+_("Select titles to: ")+"</span>";
708     [% END %]
709
710 [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
711     [% IF Koha.Preference( 'virtualshelves' ) == 1 %]
712     param1 += "<select class=\"disabled\" name=\"addto\" id=\"addto\"><option>"+_("Add to...")+"</option>";
713     [% IF Koha.Preference( 'opacbookbag' ) == 1 %]    param1 += "<option value=\"addtocart\">"+_("Cart")+"<\/option>";
714     [% END %][% IF Koha.Preference( 'virtualshelves' ) == 1 %][% IF ( loggedinusername ) %][% IF ( addbarshelves ) %]
715     param1 += "<optgroup label=\""+_("Your lists:")+"\">";[% FOREACH addbarshelvesloo IN addbarshelvesloop %]
716     param1 += "<option id=\"s[% addbarshelvesloo.shelfnumber %]\" value=\"addtolist\">[% addbarshelvesloo.shelfname |html %]<\/option>";[% END %]
717     param1 += "<\/optgroup>";[% END %]
718     [% IF ( addpubshelves ) %]param1 += "<optgroup label=\""+_("Public lists:")+"\">"[% FOREACH addpubshelvesloo IN addpubshelvesloop %]+"<option id=\"s[% addpubshelvesloo.shelfnumber %]\" value=\"addtolist\">[% addpubshelvesloo.shelfname |html %]<\/option>"[% END %];
719     param1 += "<\/optgroup>";[% END %]
720     [% IF (( addbarshelvesloop && addbarshelvesloop.size>9) || (addpubshelvesloop && addpubshelvesloop.size>9 )) %]
721         param1 += "<option value=\"morelists\">[ "+_("More lists")+" ]<\/option>";
722     [% END %]
723     param1 += "<option value=\"newlist\">[ "+_("New list")+" ]<\/option>";
724     [% END %]
725     [% END %]
726     param1 += "<\/select> <input type=\"submit\" class=\"btn btn-small\" value=\""+_("Save")+"\" />";
727     [% ELSE %]
728         param1 += "<a id=\"addto\" class=\"addtocart\" href=\"#\">" + _("Add to cart") + "<\/a>";
729     [% END %]
730 [% ELSE %]
731         param1 += "<select name=\"addto\" id=\"addto\"><option value=\"\">"+_("Add to list: ")+"<\/option>";
732 [% IF Koha.Preference( 'virtualshelves' ) == 1 %][% IF ( loggedinusername ) %][% IF ( addbarshelves ) %]
733     param1 += "<optgroup label=\""+_("Your lists:")+"\">";[% FOREACH addbarshelvesloo IN addbarshelvesloop %]
734     param1 += "<option id=\"s[% addbarshelvesloo.shelfnumber %]\" value=\"addtolist\">[% addbarshelvesloo.shelfname |html %]<\/option>";[% END %]
735     param1 += "<\/optgroup>";[% END %]
736     [% IF ( addpubshelves ) %]param1 += "<optgroup label=\""+_("Public lists:")+"\">"[% FOREACH addpubshelvesloo IN addpubshelvesloop %]+"<option id=\"s[% addpubshelvesloo.shelfnumber %]\" value=\"addtolist\">[% addpubshelvesloo.shelfname |html %]<\/option>"[% END %][% END %]
737     param1 +="<\/optgroup><option value=\"newlist\">[ "+_("New list")+" ]<\/option>"
738     [% END %]
739     [% END %]
740     param1 += "<\/select> <input type=\"submit\" class=\"btn btn-small disabled\" value=\""+_("Save")+"\" />";
741 [% END %]
742
743     $('#sortsubmit').hide();
744     $('.resort').change(function() {
745         $('#bookbag_form').submit();
746     });
747     $("span.clearall").html("<a id=\"CheckNone\" href=\"#\">"+_("Clear all")+"<\/a>");
748     $("span.checkall").html("<a id=\"CheckAll\" href=\"#\">"+_("Select all")+"<\/a>");
749
750 [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
751     $("span.addto").html(param1);
752 [% ELSE %]
753     [% IF ( ( Koha.Preference( 'virtualshelves' ) == 1 ) && loggedinusername ) %]
754         $("span.addto").html(param1);
755     [% END %]
756 [% END %]
757
758 [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
759     [% IF Koha.Preference( 'virtualshelves' ) == 1 %]
760         $("#addto").on("change",function(){
761             cartList();
762         });
763         $(".addto").find("input:submit").click(function(){
764             cartList();
765             return false;
766         });
767     [% ELSE %]
768         $("#addto").on("click",function(){
769             cartList();
770             return false;
771         });
772     [% END %]
773 [% END %]
774
775     function cartList(){
776         addtoOption = $("#addto").find("option:selected");
777         addtoval = addtoOption.val();
778         if(addtoval == "addtolist"){
779             var shelfnumber = addtoOption.attr("id").replace("s","");
780             if (vShelfAdd()) {
781                 Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?selectedshelf='+shelfnumber+'&' + vShelfAdd());
782             }
783             return false;
784         } else if(addtoval == "newlist"){
785             [% IF ( loggedinusername ) %]if (vShelfAdd()) {
786                 Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?newshelf=1&' + vShelfAdd());
787             }[% ELSE %]
788                 alert(_("You must be logged in to create or add to lists"));
789             [% END %]
790             return false;
791         } else if(addtoval == "morelists"){
792             [% IF ( loggedinusername ) %]
793                 if (vShelfAdd()) {
794                     Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?' + vShelfAdd());
795                 }
796             [% ELSE %]
797                 alert(_("You must be logged in to create or add to lists"));
798             [% END %]
799             return false;
800         }
801         if(addtoval == "addtocart" || $("#addto").attr("class") == "addtocart"){
802             addMultiple();
803             return false;
804          }
805     }
806     $("#CheckAll").click(function(){
807         $("#bookbag_form").checkCheckboxes();
808         enableCheckboxActions();
809         return false;
810     });
811     $("#CheckNone").click(function(){
812         $("#bookbag_form").unCheckCheckboxes();
813         enableCheckboxActions();
814         return false;
815     });
816
817 [% IF ( ( Koha.Preference( 'RequestOnOpac' ) == 1 ) && ( Koha.Preference( 'opacuserlogin' ) == 1 ) && DisplayMultiPlaceHold ) %]
818     $("#placehold").html("<input class=\"hold disabled\" type=\"submit\" value=\""+_("Place hold")+"\"/>");
819     $("#placehold").find("input:submit").click(function(){
820         holdMultiple();
821         return false;
822     });
823 [% END %]
824
825 [% IF ( query_desc ) %]
826     var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') |html %]";
827     var querystring = "[% querystring |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') |html %]";
828     [% IF ( OpacHighlightedWords ) %]
829         q_array = query_desc.split(" ");
830         // ensure that we don't have "" at the end of the array, which can
831         // break the highlighter
832         while (q_array.length > 0 && q_array[q_array.length-1] == "") {
833             q_array = q_array.splice(0,-1);
834         }
835         highlightOn();
836         $("#highlight_toggle_on" ).hide().click(function() {highlightOn() ;});
837         $("#highlight_toggle_off").show().click(function() {highlightOff();});
838     [% END %]
839     [% IF ( OverDriveEnabled ) %]
840         var $overdrive_results = $( '<span id="overdrive-results">' + _( 'Searching OverDrive...' ) + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></span>' );
841         $( '#numresults' ) .append( ' ' )
842             .append( $overdrive_results );
843         KOHA.OverDrive.Search( "[% OverDriveLibraryID %]", querystring, 1, 0, function( data ) {
844             if ( data.error ) {
845                 $overdrive_results.html( _( 'Error searching OverDrive collection' ) );
846                 return;
847             }
848
849             if ( data.totalItems ) {
850                 $overdrive_results.html( _( 'Found' ) + ' <a href="/cgi-bin/koha/opac-overdrive-search.pl?q=' + escape( querystring ) + '">' + data.totalItems + ' ' + _( 'results' ) + '</a> ' + _( 'in OverDrive collection' ) );
851             } else {
852                 $overdrive_results.remove();
853             }
854         } );
855     [% END %]
856 [% END %]
857
858 [% IF ( TagsInputEnabled && loggedinusername ) %]
859     $("#tagsel_tag").click(function(){
860         tagSelected();
861         return false;
862     });
863     $("#tagsel_cancel").click(function(){
864         tagCanceled();
865         return false;
866     });
867     $("#tagsel_button").click(function(){
868         tagAdded();
869         return false;
870     });
871
872     $(".tag_add").click(function(){
873         var thisid = $(this).attr("id");
874         thisid = thisid.replace("tag_add","");
875         $(this).addClass("hidden");
876         $("#tagform"+thisid).show();
877         $("#newtag"+thisid).focus();
878         $("#newtag"+thisid+"_status").empty().hide();
879         return false;
880     });
881     $(".cancel_tag_add").click(function(){
882         var thisid = $(this).attr("id");
883         thisid = thisid.replace("cancel","");
884         $("#tagform"+thisid).hide();
885         $("#tag_add"+thisid).removeClass("hidden");
886         $("#newtag"+thisid).val("");
887         $("#newtag"+thisid+"_status").empty().hide();
888         return false;
889     });
890     $(".tagbutton").click(function(){
891         var thisid = $(this).attr("title");
892         var tag = $("#newtag"+thisid).val();
893         if (!tag || (tag == "")) {
894             alert(MSG_NO_TAG_SPECIFIED);
895             return false;
896         }
897         KOHA.Tags.add_tag_button(thisid, tag);
898         return false;
899     });
900 [% END %]
901
902 [% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %]
903 [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
904 [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
905
906 [% IF ( DidYouMean ) %]
907     $("#didyoumean").load("/cgi-bin/koha/svc/suggestion?render=stub&q=[% querystring |uri %]",
908         function() {
909             $(".searchsuggestion").parent().parent().css({
910                 "border-color": "#F4ECBE",
911                 "background-color": "#FFFBEA"
912             });
913         });
914 [% END %]
915
916 });
917 //]]>
918 </script>
919 [% END %]