]> git.koha-community.org Git - koha.git/blob - koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt
Bug 6149: Follow-up [bootstrap] - Stopwords for Result Highlighting
[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                                                                 [% IF ( using_https ) %]
231                                                                     <span title="[% SEARCH_RESULT.biblionumber %]" id="amazon-thumbnail[% loop.count %]"><img src="https://images-na.ssl-images-amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="item-thumbnail" /></span>
232                                                                 [% ELSE %]
233                                                                 <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>
234                                                                 [% END %]
235                                                             [% ELSE %]
236                                                                 <span class="no-image">No cover image available</span>
237                                                             [% END %]
238                                                         [% END %]
239
240                                                         [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
241                                                             [% IF SEARCH_RESULT.normalized_isbn %]
242                                                                     [% IF ( using_https ) %]
243                                                                         <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>
244                                                                     [% ELSE %]
245                                                                         <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>
246                                                                     [% END %]
247                                                             [% ELSE %]
248                                                                 <span class="no-image">No cover image available</span>
249                                                             [% END %]
250                                                         [% END %]
251
252                                                         [% IF ( GoogleJackets ) %]
253                                                             [% IF ( SEARCH_RESULT.normalized_isbn ) %]
254                                                                 <span style="block" title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></span>
255                                                             [% ELSE %]
256                                                                 <span class="no-image">No cover image available</span>
257                                                             [% END %]
258                                                         [% END %]
259
260                                                         [% IF OpenLibraryCovers %]
261                                                             [% IF SEARCH_RESULT.normalized_isbn %]
262                                                                 <span style="block" title="[% SEARCH_RESULT.biblionumber %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="openlibrary-thumbnail[% loop.count %]"></span>
263                                                             [% ELSE %]
264                                                                 <span class="no-image">No cover image available</span>
265                                                             [% END %]
266                                                         [% END %]
267                                                     </a>
268
269                                                     [% IF ( BakerTaylorEnabled ) %]
270                                                         [% IF ( SEARCH_RESULT.normalized_isbn ) %]
271                                                             <a href="https://[% BakerTaylorBookstoreURL |html %][% SEARCH_RESULT.normalized_isbn %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% SEARCH_RESULT.normalized_isbn %]" /></a>
272                                                         [% ELSE %]
273                                                             <span class="no-image">No cover image available</span>
274                                                         [% END %]
275                                                     [% END %]
276
277                                                     [% IF ( IDreamBooksResults && SEARCH_RESULT.normalized_isbn ) %]
278                                                         <div class="idbresult" style="display: none;">
279                                                             [% IF ( IDreamBooksReviews ) %]
280                                                                 <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]#idb_critic_reviews">
281                                                             [% ELSE %]
282                                                                 <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">
283                                                             [% END %]
284                                                             [% SEARCH_RESULT.normalized_isbn %]</a>
285                                                         </div>
286                                                     [% END %]
287                                                 </div>
288                                                 [% IF ( COinSinOPACResults && SEARCH_RESULT.coins ) %]
289                                                     <!-- COinS / Openurl -->
290                                                     <span class="Z3988" title="[% SEARCH_RESULT.coins %]"></span>
291                                                 [% END %]
292
293                                                 [% IF ( OPACXSLTResultsDisplay ) %]
294                                                     [% SEARCH_RESULT.XSLTResultsRecord %]
295                                                 [% ELSE %]
296                                                     [% IF ( BiblioDefaultViewmarc ) %]
297                                                         <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]" title="View details for this title">
298                                                     [% ELSE %]
299                                                         [% IF ( BiblioDefaultViewisbd ) %]
300                                                             <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]" title="View details for this title">
301                                                         [% ELSE %]
302                                                             <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]" title="View details for this title">
303                                                         [% END %]
304                                                     [% END %]
305
306                                                     [% IF ( SEARCH_RESULT.title ) %]
307                                                         [% SEARCH_RESULT.title |html %]
308                                                     [% ELSE %]
309                                                         No title
310                                                     [% END %]
311
312                                                     [% FOREACH subtitl IN SEARCH_RESULT.subtitle %]
313                                                         , [% subtitl.subfield|html %]
314                                                     [% END %]</a>
315
316                                                     [% IF ( SEARCH_RESULT.author ) %]
317                                                         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>
318                                                     [% ELSE %]
319                                                         &nbsp;
320                                                     [% END %]
321
322                                                     <span class="results_summary publisher">
323                                                         <span class="label">Publication:</span>
324                                                             [% IF ( SEARCH_RESULT.place ) %][% SEARCH_RESULT.place %] [% END %]
325                                                             [% IF ( SEARCH_RESULT.publishercode ) %][% SEARCH_RESULT.publishercode|html %][% END %]
326                                                             [% IF ( SEARCH_RESULT.publicationyear ) %]
327                                                                 [% SEARCH_RESULT.publicationyear %]
328                                                             [% ELSE %]
329                                                                 [% IF ( SEARCH_RESULT.copyrightdate ) %]
330                                                                     [% SEARCH_RESULT.copyrightdate %]
331                                                                 [% END %]
332                                                             [% END %]
333                                                             [% IF ( SEARCH_RESULT.pages ) %]. [% SEARCH_RESULT.pages %][% END %]
334                                                             [% IF ( SEARCH_RESULT.notes ) %], [% SEARCH_RESULT.notes|html %][% END %]
335                                                             [% IF ( SEARCH_RESULT.size ) %] [% SEARCH_RESULT.size %][% END %]
336                                                             [% IF ( SEARCH_RESULT.timestamp ) %] <i>(modified on [% SEARCH_RESULT.timestamp %])</i>[% END %]
337                                                     </span>
338
339                                                     [% IF ( SEARCH_RESULT.summary ) %]
340                                                         <span class="result_summary">
341                                                             [% SEARCH_RESULT.summary %]
342                                                         </span>
343                                                     [% END %]
344
345                                                     [% IF ( SEARCH_RESULT.copyrightdate ) %]
346                                                         <span class="results_summary date">
347                                                             <span class="label">Date:</span>
348                                                             [% SEARCH_RESULT.copyrightdate %]
349                                                         </span>
350                                                     [% END %]
351
352                                                     <span class="results_summary">
353                                                         <span class="label">Availability:</span>
354                                                             [% IF ( SEARCH_RESULT.available_items_loop.size() ) %]
355                                                                 <span class="available"><strong>Items available:</strong>
356                                                                     [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
357                                                                         [% IF available_items_loo.this_branch %]
358                                                                             <span class="highlight-row-results">
359                                                                         [% ELSE %]
360                                                                             <span>
361                                                                         [% END %]
362
363                                                                         [% IF ( singleBranchMode ) %]
364                                                                             [% available_items_loo.location %]
365                                                                         [% ELSE %]
366                                                                             [% available_items_loo.branchname %]
367                                                                         [% END %]
368
369                                                                         [% IF ( OPACItemsResultsDisplay ) %]
370                                                                             [% UNLESS ( singleBranchMode ) %][% available_items_loo.location %][% END %]
371                                                                             [% 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 %]
372                                                                         [% END %]
373                                                                         ([% available_items_loo.count %]),
374                                                                         </span>
375                                                                     [% END # / FOREACH available_items_loo %]
376                                                                 </span>
377                                                             [% ELSE %]
378                                                                 [% IF ( SEARCH_RESULT.ALTERNATEHOLDINGS ) %]
379                                                                     [% FOREACH ALTERNATEHOLDING IN SEARCH_RESULT.ALTERNATEHOLDINGS %]
380                                                                         &nbsp;<span id="alternateholdings">[% ALTERNATEHOLDING.holding %]</span>,
381                                                                     [% END %]
382                                                                 [% ELSE %]
383                                                                     <span class="unavailable">No items available:</span>
384                                                                 [% END %]
385                                                             [% END # / IF SEARCH_RESULT.available_items_loop.size %]
386
387                                                             <span class="unavailable">
388                                                                 [% IF ( SEARCH_RESULT.onloancount ) %] Checked out ([% SEARCH_RESULT.onloancount %]), [% END %]
389                                                                 [% IF ( SEARCH_RESULT.withdrawncount ) %] Withdrawn ([% SEARCH_RESULT.withdrawncount %]), [% END %]
390                                                                 [% UNLESS ( SEARCH_RESULT.hidelostitems ) %][% IF ( SEARCH_RESULT.itemlostcount ) %] Lost ([% SEARCH_RESULT.itemlostcount %]),[% END %][% END %]
391                                                                 [% IF ( SEARCH_RESULT.damagedcount ) %] Damaged ([% SEARCH_RESULT.damagedcount %]),[% END %]
392                                                                 [% IF ( SEARCH_RESULT.orderedcount ) %] On order ([% SEARCH_RESULT.orderedcount %]),[% END %]
393                                                                 [% IF ( SEARCH_RESULT.onholdcount ) %] On hold ([% SEARCH_RESULT.onholdcount %]),[% END %]
394                                                                 [% IF ( SEARCH_RESULT.intransitcount ) %] In transit ([% SEARCH_RESULT.intransitcount %]),[% END %]
395                                                             </span>
396                                                     </span> <!-- / .results_summary -->
397                                                 [% END # / IF OPACXSLTResultsDisplay %]
398
399                                                 [% IF ( SEARCH_RESULT.score_avg ) %]
400                                                     <div class="results_summary">
401                                                         [% FOREACH i  IN [ 1 2 3 4 5  ] %]
402                                                             [% IF ( SEARCH_RESULT.score_int >= i ) %]
403                                                                 <div class="star-rating rater-[% i %] star star-rating-applied star-rating-readonly star-rating-on"><a title="[% i %]">[% i %]</a></div>
404                                                             [% ELSE   %]
405                                                                 <div class="star-rating rater-[% i %] star star-rating-applied star-rating-readonly"><a title="[% i %]">[% i %]</a></div>
406                                                             [% END %]
407                                                         [% END %]
408                                                         <span id="babeltheque-rating_total_[% SEARCH_RESULT.biblionumber %]">&nbsp;&nbsp; [% SEARCH_RESULT.score_avg %] / 5 (on [% SEARCH_RESULT.num_scores %] rates)</span>
409
410                                                         [% IF ( SEARCH_RESULT.num_critics ) %]
411                                                             <span class="social_data">[% SEARCH_RESULT.num_critics %] Internet user critics</span>
412                                                         [% END %]
413                                                         [% IF ( SEARCH_RESULT.num_critics_pro ) %]
414                                                             <span class="social_data">[% SEARCH_RESULT.num_critics_pro %] Professional critics</span>
415                                                         [% END %]
416                                                         [% IF ( SEARCH_RESULT.num_videos ) %]
417                                                             <span class="social_data">[% SEARCH_RESULT.num_videos %] Video extracts</span>
418                                                         [% END %]
419                                                         [% IF ( SEARCH_RESULT.num_quotations ) %]
420                                                             <span class="social_data">[% SEARCH_RESULT.num_quotations %] Quotations</span>
421                                                         [% END %]
422                                                     </div> <!-- / .results_summary -->
423                                                 [% END # / IF SEARCH_RESULT.score_avg %]
424
425                                                 [% IF ( LibraryThingForLibrariesID ) %]
426                                                     <div class="ltfl_reviews"></div>
427                                                 [% END %]
428
429                                                 [% IF ( TagsShowEnabled && SEARCH_RESULT.TagLoop.size ) %]
430                                                     <div class="results_summary tags">
431                                                         <span class="label">Tags:</span>
432                                                         <ul>
433                                                             [% FOREACH TagLoo IN SEARCH_RESULT.TagLoop %]
434                                                                 <li>
435                                                                     <a href="/cgi-bin/koha/opac-search.pl?tag=[% TagLoo.term |url %]&amp;q=[% TagLoo.term |url %]">[% TagLoo.term %]</a>
436                                                                     <span class="weight">([% TagLoo.weight_total %])</span>
437                                                                 </li>
438                                                             [% END %]
439                                                         </ul>
440                                                     </div>
441                                                 [% END %]
442
443                                                 [% IF ( SEARCH_RESULT.searchhighlightblob ) %]
444                                                     <span class="results_summary">
445                                                         <span class="label">Match:</span>
446                                                         [% SEARCH_RESULT.searchhighlightblob %]
447                                                     </span>
448                                                 [% END %]
449
450                                                 [% IF ( OpacStarRatings == 'all' ) %]
451                                                     <div class="results_summary ratings">
452                                                         [% FOREACH i  IN [ 1 2 3 4 5  ] %]
453                                                             [% IF ( SEARCH_RESULT.rating_avg == i ) %]
454                                                                 <input class="star" type="radio"  name="rating-[% SEARCH_RESULT.biblionumber %]" value="[% i %]" checked="checked" disabled="disabled"   />
455                                                             [% ELSE   %]
456                                                                 <input class="star" type="radio"  name="rating-[% SEARCH_RESULT.biblionumber %]" value="[% i %]" disabled="disabled"   />
457                                                             [% END %]
458                                                         [% END %]
459
460                                                         <input type="hidden" name="biblionumber"  value="[% SEARCH_RESULT.biblionumber %]" />
461                                                         <input type="hidden" name="loggedinuser"  value="[% loggedinuser %]" />
462
463                                                         [% IF (  SEARCH_RESULT.rating_total ) > 0  %]
464                                                             <span id="rating_total_[% SEARCH_RESULT.biblionumber %]">&nbsp;&nbsp;([% SEARCH_RESULT.rating_total %] votes)</span>
465                                                         [% ELSE %]
466                                                             <br />
467                                                         [% END %]
468                                                     </div> <!-- / .results_summary -->
469                                                 [% END # / IF OpacStarRatings %]
470
471                                                 <div class="actions-menu">
472                                                         [% IF Koha.Preference( 'RequestOnOpac' ) == 1 %]
473                                                             [% UNLESS ( SEARCH_RESULT.norequests ) %]
474                                                                 [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && AllowOnShelfHolds ) %]
475                                                                     <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-->
476                                                                 [% ELSE %]
477                                                                     [% IF ( SEARCH_RESULT.itemsissued ) %]
478                                                                         <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-->
479                                                                     [% END %]
480                                                                 [% END # / IF opacuserlogin && AllowOnShelfHolds %]
481                                                             [% END # UNLESS SEARCH_RESULT.norequests %]
482                                                         [% END # IF RequestOnOpac %]
483
484                                                         [% IF ( TagsInputEnabled ) %]
485                                                             [% IF ( loggedinusername ) %]
486                                                                 <span class="actions"><a class="tag_add" id="tag_add[% SEARCH_RESULT.biblionumber %]" href="#">Add tag</a></span>
487                                                                 <div id="tagform[% SEARCH_RESULT.biblionumber %]" class="tag_results_input" style="display:none;">
488                                                                         <label for="newtag[% SEARCH_RESULT.biblionumber %]">New tag(s), separated by a comma:</label>
489                                                                         <input type="text" name="newtag[% SEARCH_RESULT.biblionumber %]" id="newtag[% SEARCH_RESULT.biblionumber %]" maxlength="100" />
490                                                                         <input name="tagbutton" class="btn btn-small tagbutton" title="[% SEARCH_RESULT.biblionumber %]" type="submit" value="Add" />
491                                                                         <a class="cancel_tag_add" id="cancel[% SEARCH_RESULT.biblionumber %]" href="#">(done)</a>
492                                                                 </div>
493                                                                 <span id="newtag[% SEARCH_RESULT.biblionumber %]_status" class="tagstatus" style="display:none;">
494                                                                     Tag status here.
495                                                                 </span>
496                                                             [% ELSIF ( loop.first ) %]
497                                                                 <span class="actions"><span id="login4tags">Log in to add tags.</span></span>
498                                                             [% END # IF loggedinusername %]
499                                                         [% END # if TagsInputEnabled %]
500
501                                                         [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && loggedinusername && ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
502                                                             <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>
503                                                         [% END %]
504
505                                                         [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
506                                                             [% IF ( SEARCH_RESULT.incart ) %]
507                                                                 <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>
508                                                             [% ELSE %]
509                                                                 <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>
510                                                             [% END %]
511                                                         [% END # / IF opacbookbag %]
512                                                 </div>
513                                             </td>
514                                         </tr>
515                                     [% END # / FOREACH SEARCH_RESULT %]
516                                 </table>
517                             </form> <!-- / #bookbag_form -->
518
519                             <form id="hold_form" name="hold_form" method="get" action="/cgi-bin/koha/opac-reserve.pl">
520                                 <!-- The value will be set by holdBiblioNums() in basket.js -->
521                                 <input id="hold_form_biblios" type="hidden" name="biblionumbers" value=""/>
522                             </form>
523                         </div> <!-- / .searchresults -->
524
525                         <div id="bottom-pages">[% INCLUDE 'page-numbers.inc' %]</div>
526
527                     [% END # / IF total %]
528
529                     [% IF Koha.Preference( 'suggestion' ) == 1 %]
530                         [% IF Koha.Preference( 'AnonSuggestions' ) == 1 %]
531                             <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>
532                         [% ELSE %]
533                             [% IF ( loggedinusername ) %]
534                                 <div class="suggestion">
535                                     Not finding what you're looking for?<br />  Make a <a href="/cgi-bin/koha/opac-suggestions.pl?op=add">purchase suggestion</a>
536                                 </div>
537                             [% END %]
538                         [% END %]
539                     [% END %]
540                     </div> <!-- / #userresults -->
541                 </div> <!-- /.span10/12 -->
542             </div> <!-- / .row-fluid -->
543         </div> <!-- / .container-fluid -->
544     </div><!-- / .main -->
545
546 [% INCLUDE 'opac-bottom.inc' %]
547 [% BLOCK jsinclude %]
548 [% IF ( LibraryThingForLibrariesID ) %]
549     [% IF ( using_https ) %]
550         <script src="https://ltfl.librarything.com/forlibraries/widget.js?id=[% LibraryThingForLibrariesID %]&amp;systype=koha" type="text/javascript"></script>
551     [% ELSE %]
552         <script src="http://ltfl.librarything.com/forlibraries/widget.js?id=[% LibraryThingForLibrariesID %]&amp;systype=koha" type="text/javascript"></script>
553     [% END %]
554 [% END %]
555 [% IF ( OpacStarRatings == 'all' || Koha.Preference('Babeltheque') ) %]<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.rating.js"></script>[% END %]
556 [% IF ( OverDriveEnabled ) %]<script type="text/javascript" src="[% interface %]/[% theme %]/js/overdrive.js"></script>[% END %]
557 <script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
558 [% IF ( OpacHighlightedWords ) %]<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.highlight-3.js"></script>
559 [% END %]<script type="text/javascript">
560 //<![CDATA[
561 [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'RequestOnOpac' ) == 1 ) %]
562 function holdMultiple() {
563     var checkedBiblioNums = ""; // Separated by "/"
564     var checkedCount = 0;
565     if(document.bookbag_form.biblionumber.length > 0) {
566         for (var i=0; i < document.bookbag_form.biblionumber.length; i++) {
567             if (document.bookbag_form.biblionumber[i].checked) {
568                 checkedBiblioNums += (document.bookbag_form.biblionumber[i].value + "/");
569                 checkedCount++;
570             }
571         }
572     }
573
574     if (checkedCount > 0) {
575         holdBiblioNums(checkedBiblioNums);
576     } else {
577         alert(MSG_NO_RECORD_SELECTED);
578     }
579 }
580
581 function holdBiblioNums(numList) {
582     // numList: biblio numbers separated by "/"
583     $("#hold_form_biblios").attr("value", numList);
584     $("#hold_form").submit();
585 }[% END %]
586
587 [% IF ( TagsInputEnabled && loggedinusername ) %]
588 function tagSelected() {
589     var checkedBoxes = $(".searchresults :checkbox:checked");
590     if ($(checkedBoxes).size() == 0) {
591         alert(MSG_NO_RECORD_SELECTED);
592     } else {
593         $("#tagsel_tag").hide();
594         $(".resort").hide();
595         $("#tagsel_form").show();
596     }
597 }
598
599 function tagCanceled() {
600     $("#tagsel_form").hide();
601     $("#tagsel_tag").show();
602     $(".resort").show();
603     $("#tagsel_new").val("");
604     $("#tagsel_status, .tagstatus").empty().hide();
605 }
606
607 function tagAdded() {
608     var checkedBoxes = $(".searchresults :checkbox:checked");
609     if ($(checkedBoxes).size() == 0) {
610         alert(MSG_NO_RECORD_SELECTED);
611         return false;
612     }
613
614     var tag = $("#tagsel_new").val();
615     if (!tag || (tag == "")) {
616         alert(MSG_NO_TAG_SPECIFIED);
617         return false;
618     }
619
620     var bibs = [];
621     for (var i = 0; i < $(checkedBoxes).size(); i++) {
622         var box = $(checkedBoxes).get(i);
623         bibs[i] = $(box).val();
624     }
625
626     KOHA.Tags.add_multitags_button(bibs, tag);
627     return false;
628 }[% END %]
629
630
631 function enableCheckboxActions(){
632     // Enable/disable controls if checkboxes are checked
633     var checkedBoxes = $(".checkboxed input:checkbox:checked");
634     var controls = $("#selections-toolbar .links a, #selections-toolbar .links input, #selections-toolbar .links select, , #selections-toolbar .links label")
635     if ($(checkedBoxes).size()) {
636       $("#selections").html(_("With selected titles: "));
637       $(controls).removeClass("disabled");
638     } else {
639       $("#selections").html(_("Select titles to: "));
640       $(controls).addClass("disabled");
641     }
642 }
643
644 [% IF ( OpacHighlightedWords ) %]
645 var q_array = new Array();  // holds search terms if available
646
647 function highlightOff() {
648     $("td").removeHighlight();
649     $(".highlight_toggle").toggle();
650 }
651 function highlightOn() {
652     var x;
653     for (x in q_array) {
654         q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
655         q_array[x] = q_array[x].toLowerCase();
656         var myStopwords = "[% Koha.Preference('HighlightedStopWords') %]".toLowerCase().split('|');
657         if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
658             $(".title").highlight(q_array[x]);
659             $(".author").highlight(q_array[x]);
660             $(".results_summary").highlight(q_array[x]);
661         }
662     }
663     $(".highlight_toggle").toggle();
664 }
665 [% END %]
666 $(document).ready(function(){
667     [% IF ( OpacHighlightedWords ) %]
668         $('a.title').each(function() {
669             $(this).attr("href", $(this).attr("href") + "&query_desc=[% query_desc | uri %]");
670         });
671     [% END %]
672
673     $(".cb").click(function(){
674       enableCheckboxActions();
675     });
676     enableCheckboxActions();
677
678     [% IF ( IDreamBooksResults ) %]
679         $('.idbresult').each(function() {
680             var isbn = $(this).children('a').text().replace(/\s*/,'');
681             var element = this;
682
683             if ($.browser.msie && parseInt($.browser.version, 10) >= 8 && window.XDomainRequest) {
684             // Use Microsoft XDR for IE version 8 or above
685                 var xdr = new XDomainRequest();
686                 xdr.open("get", "http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e");
687                 xdr.onload = function() {
688                     json = 'json = '+xdr.responseText; // the string now looks like..  json = { ... };
689                     eval(json); // json is now a regular JSON object
690                     if(json.total_results > 0 && json.book.rating > 0){
691                         $(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+"%");
692                         $(element).show();
693                     } else {
694                         $(element).remove();
695                     }
696                 }
697                 xdr.send();
698             } else {
699                 $.getJSON("http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){
700                     if(json.total_results > 0 && json.book.rating > 0){
701                         $(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+"%");
702                         $(element).show();
703                     } else {
704                         $(element).remove();
705                     }
706                 });
707             }
708         });
709     [% END %]
710
711     var param1 = "";
712     [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) || loggedinusername ) %]
713     param1 += "<span id=\"selections\">"+_("Select titles to: ")+"</span>";
714     [% END %]
715
716 [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
717     [% IF Koha.Preference( 'virtualshelves' ) == 1 %]
718     param1 += "<select class=\"disabled\" name=\"addto\" id=\"addto\"><option>"+_("Add to...")+"</option>";
719     [% IF Koha.Preference( 'opacbookbag' ) == 1 %]    param1 += "<option value=\"addtocart\">"+_("Cart")+"<\/option>";
720     [% END %][% IF Koha.Preference( 'virtualshelves' ) == 1 %][% IF ( loggedinusername ) %][% IF ( addbarshelves ) %]
721     param1 += "<optgroup label=\""+_("Your lists:")+"\">";[% FOREACH addbarshelvesloo IN addbarshelvesloop %]
722     param1 += "<option id=\"s[% addbarshelvesloo.shelfnumber %]\" value=\"addtolist\">[% addbarshelvesloo.shelfname |html %]<\/option>";[% END %]
723     param1 += "<\/optgroup>";[% END %]
724     [% IF ( addpubshelves ) %]param1 += "<optgroup label=\""+_("Public lists:")+"\">"[% FOREACH addpubshelvesloo IN addpubshelvesloop %]+"<option id=\"s[% addpubshelvesloo.shelfnumber %]\" value=\"addtolist\">[% addpubshelvesloo.shelfname |html %]<\/option>"[% END %];
725     param1 += "<\/optgroup>";[% END %]
726     [% IF (( addbarshelvesloop && addbarshelvesloop.size>9) || (addpubshelvesloop && addpubshelvesloop.size>9 )) %]
727         param1 += "<option value=\"morelists\">[ "+_("More lists")+" ]<\/option>";
728     [% END %]
729     param1 += "<option value=\"newlist\">[ "+_("New list")+" ]<\/option>";
730     [% END %]
731     [% END %]
732     param1 += "<\/select> <input type=\"submit\" class=\"btn btn-small\" value=\""+_("Save")+"\" />";
733     [% ELSE %]
734         param1 += "<a id=\"addto\" class=\"addtocart\" href=\"#\">" + _("Add to cart") + "<\/a>";
735     [% END %]
736 [% ELSE %]
737         param1 += "<select name=\"addto\" id=\"addto\"><option value=\"\">"+_("Add to list: ")+"<\/option>";
738 [% IF Koha.Preference( 'virtualshelves' ) == 1 %][% IF ( loggedinusername ) %][% IF ( addbarshelves ) %]
739     param1 += "<optgroup label=\""+_("Your lists:")+"\">";[% FOREACH addbarshelvesloo IN addbarshelvesloop %]
740     param1 += "<option id=\"s[% addbarshelvesloo.shelfnumber %]\" value=\"addtolist\">[% addbarshelvesloo.shelfname |html %]<\/option>";[% END %]
741     param1 += "<\/optgroup>";[% END %]
742     [% IF ( addpubshelves ) %]param1 += "<optgroup label=\""+_("Public lists:")+"\">"[% FOREACH addpubshelvesloo IN addpubshelvesloop %]+"<option id=\"s[% addpubshelvesloo.shelfnumber %]\" value=\"addtolist\">[% addpubshelvesloo.shelfname |html %]<\/option>"[% END %][% END %]
743     param1 +="<\/optgroup><option value=\"newlist\">[ "+_("New list")+" ]<\/option>"
744     [% END %]
745     [% END %]
746     param1 += "<\/select> <input type=\"submit\" class=\"btn btn-small disabled\" value=\""+_("Save")+"\" />";
747 [% END %]
748
749     $('#sortsubmit').hide();
750     $('.resort').change(function() {
751         $('#bookbag_form').submit();
752     });
753     $("span.clearall").html("<a id=\"CheckNone\" href=\"#\">"+_("Clear all")+"<\/a>");
754     $("span.checkall").html("<a id=\"CheckAll\" href=\"#\">"+_("Select all")+"<\/a>");
755
756 [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
757     $("span.addto").html(param1);
758 [% ELSE %]
759     [% IF ( ( Koha.Preference( 'virtualshelves' ) == 1 ) && loggedinusername ) %]
760         $("span.addto").html(param1);
761     [% END %]
762 [% END %]
763
764 [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
765     [% IF Koha.Preference( 'virtualshelves' ) == 1 %]
766         $("#addto").on("change",function(){
767             cartList();
768         });
769         $(".addto").find("input:submit").click(function(){
770             cartList();
771             return false;
772         });
773     [% ELSE %]
774         $("#addto").on("click",function(){
775             cartList();
776             return false;
777         });
778     [% END %]
779 [% END %]
780
781     function cartList(){
782         addtoOption = $("#addto").find("option:selected");
783         addtoval = addtoOption.val();
784         if(addtoval == "addtolist"){
785             var shelfnumber = addtoOption.attr("id").replace("s","");
786             if (vShelfAdd()) {
787                 Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?selectedshelf='+shelfnumber+'&' + vShelfAdd());
788             }
789             return false;
790         } else if(addtoval == "newlist"){
791             [% IF ( loggedinusername ) %]if (vShelfAdd()) {
792                 Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?newshelf=1&' + vShelfAdd());
793             }[% ELSE %]
794                 alert(_("You must be logged in to create or add to lists"));
795             [% END %]
796             return false;
797         } else if(addtoval == "morelists"){
798             [% IF ( loggedinusername ) %]
799                 if (vShelfAdd()) {
800                     Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?' + vShelfAdd());
801                 }
802             [% ELSE %]
803                 alert(_("You must be logged in to create or add to lists"));
804             [% END %]
805             return false;
806         }
807         if(addtoval == "addtocart" || $("#addto").attr("class") == "addtocart"){
808             addMultiple();
809             return false;
810          }
811     }
812     $("#CheckAll").click(function(){
813         $("#bookbag_form").checkCheckboxes();
814         enableCheckboxActions();
815         return false;
816     });
817     $("#CheckNone").click(function(){
818         $("#bookbag_form").unCheckCheckboxes();
819         enableCheckboxActions();
820         return false;
821     });
822
823 [% IF ( ( Koha.Preference( 'RequestOnOpac' ) == 1 ) && ( Koha.Preference( 'opacuserlogin' ) == 1 ) && DisplayMultiPlaceHold ) %]
824     $("#placehold").html("<input class=\"hold disabled\" type=\"submit\" value=\""+_("Place hold")+"\"/>");
825     $("#placehold").find("input:submit").click(function(){
826         holdMultiple();
827         return false;
828     });
829 [% END %]
830
831 [% IF ( query_desc ) %]
832     var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') |html %]";
833     var querystring = "[% querystring |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') |html %]";
834     [% IF ( OpacHighlightedWords ) %]
835         q_array = query_desc.split(" ");
836         // ensure that we don't have "" at the end of the array, which can
837         // break the highlighter
838         while (q_array.length > 0 && q_array[q_array.length-1] == "") {
839             q_array = q_array.splice(0,-1);
840         }
841         highlightOn();
842         $("#highlight_toggle_on" ).hide().click(function() {highlightOn() ;});
843         $("#highlight_toggle_off").show().click(function() {highlightOff();});
844     [% END %]
845     [% IF ( OverDriveEnabled ) %]
846         var $overdrive_results = $( '<span id="overdrive-results">' + _( 'Searching OverDrive...' ) + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></span>' );
847         $( '#numresults' ) .append( ' ' )
848             .append( $overdrive_results );
849         KOHA.OverDrive.Search( "[% OverDriveLibraryID %]", querystring, 1, 0, function( data ) {
850             if ( data.error ) {
851                 $overdrive_results.html( _( 'Error searching OverDrive collection' ) );
852                 return;
853             }
854
855             if ( data.totalItems ) {
856                 $overdrive_results.html( _( 'Found' ) + ' <a href="/cgi-bin/koha/opac-overdrive-search.pl?q=' + escape( querystring ) + '">' + data.totalItems + ' ' + _( 'results' ) + '</a> ' + _( 'in OverDrive collection' ) );
857             } else {
858                 $overdrive_results.remove();
859             }
860         } );
861     [% END %]
862 [% END %]
863
864 [% IF ( TagsInputEnabled && loggedinusername ) %]
865     $("#tagsel_tag").click(function(){
866         tagSelected();
867         return false;
868     });
869     $("#tagsel_cancel").click(function(){
870         tagCanceled();
871         return false;
872     });
873     $("#tagsel_button").click(function(){
874         tagAdded();
875         return false;
876     });
877
878     $(".tag_add").click(function(){
879         var thisid = $(this).attr("id");
880         thisid = thisid.replace("tag_add","");
881         $(this).addClass("hidden");
882         $("#tagform"+thisid).show();
883         $("#newtag"+thisid).focus();
884         $("#newtag"+thisid+"_status").empty().hide();
885         return false;
886     });
887     $(".cancel_tag_add").click(function(){
888         var thisid = $(this).attr("id");
889         thisid = thisid.replace("cancel","");
890         $("#tagform"+thisid).hide();
891         $("#tag_add"+thisid).removeClass("hidden");
892         $("#newtag"+thisid).val("");
893         $("#newtag"+thisid+"_status").empty().hide();
894         return false;
895     });
896     $(".tagbutton").click(function(){
897         var thisid = $(this).attr("title");
898         var tag = $("#newtag"+thisid).val();
899         if (!tag || (tag == "")) {
900             alert(MSG_NO_TAG_SPECIFIED);
901             return false;
902         }
903         KOHA.Tags.add_tag_button(thisid, tag);
904         return false;
905     });
906 [% END %]
907
908 [% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %]
909 [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
910 [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
911
912 [% IF ( DidYouMean ) %]
913     $("#didyoumean").load("/cgi-bin/koha/svc/suggestion?render=stub&q=[% querystring |uri %]",
914         function() {
915             $(".searchsuggestion").parent().parent().css({
916                 "border-color": "#F4ECBE",
917                 "background-color": "#FFFBEA"
918             });
919         });
920 [% END %]
921
922 });
923 //]]>
924 </script>
925 [% END %]