Bug 11516: make OPAC search term highlighting work in results browser
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-detail.tt
1 [% USE Koha %]
2 [% USE KohaDates %]
3 [% USE AuthorisedValues %]
4 [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnDetail ) %]
5 [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnDetail ) %]
6
7 [% ShowCourseReservesHeader = 0 %]
8 [% IF Koha.Preference( 'UseCourseReserves' ) == 1 %]
9     [% FOREACH ITEM_RESULT IN itemloop %]
10        [% IF ITEM_RESULT.course_reserves %]
11            [% FOREACH r IN ITEM_RESULT.course_reserves %]
12                [% IF r.course.enabled == 'yes' %]
13                    [% ShowCourseReservesHeader = 1 %]
14                [% END %]
15            [% END %]
16         [% END %]
17     [% END %]
18 [% END %]
19
20 [% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Details for: [% title |html %][% FOREACH subtitl IN subtitle %], [% subtitl.subfield |html %][% END %]
21 [% INCLUDE 'doc-head-close.inc' %]
22 [% IF ( bidi ) %]
23   [% BLOCK cssinclude %]<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/right-to-left.css" />[% END %]
24 [% END %]
25 [% IF ( OpacStarRatings != 'disable' ) %]
26     [% BLOCK cssinclude %]<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/jquery.rating.css" />[% END %]
27 [% END %]
28 </head>
29 <body id="opac-detail" class="scrollto">
30 [% INCLUDE 'masthead.inc' %]
31
32 <div class="main">
33     <ul class="breadcrumb">
34         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
35         <li><a href="#">Details for: [% title |html %][% FOREACH subtitl IN subtitle %], [% subtitl.subfield |html %][% END %]</a></li>
36     </ul>
37
38     <div class="container-fluid">
39         <div class="row-fluid">
40             <div class="span9">
41                 <div id="catalogue_detail_biblio" class="maincontent">
42
43                     <div id="bookcover">
44                     [% IF ( OPACLocalCoverImages ) %]
45                         <div title="[% biblionumber |url %]" class="[% biblionumber %]" id="local-thumbnail-preview"></div>
46                     [% END %]
47                     [% IF ( OPACAmazonCoverImages ) %]
48                         [% IF ( OPACurlOpenInNewWindow ) %]
49                             <a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link" target="_blank"><img src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="Cover image" /></a>
50                         [% ELSE %]
51                             <a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="Cover image" /></a>
52                         [% END %]
53                     [% END %]
54
55                     [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
56                         [% IF ( content_identifier_exists ) %]
57                             [% IF ( using_https ) %]
58                                 <img src="https://secure.syndetics.com/index.aspx?isbn=[% normalized_isbn %]/[% SyndeticsCoverImageSize %].GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% normalized_upc %]&amp;oclc=[% normalized_oclc %]" alt="" class="thumbnail" />
59                             [% ELSE %]
60                                 <img src="http://www.syndetics.com/index.aspx?isbn=[% normalized_isbn %]/[% SyndeticsCoverImageSize %].GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% normalized_upc %]&amp;oclc=[% normalized_oclc %]" alt="" class="thumbnail" />
61                             [% END %]
62
63                         [% ELSE %]
64                             <span class="no-image">No cover image available</span>
65                         [% END %]
66                     [% END %]
67
68                     [% IF ( GoogleJackets ) %]
69                         <div title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="gbs-thumbnail-preview"></div>
70                     [% END %]
71                     [% IF OpenLibraryCovers %]
72                         <div title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="openlibrary-thumbnail-preview"></div>
73                     [% END %]
74                     [% IF ( BakerTaylorEnabled && normalized_isbn ) %]
75                         [% IF ( OPACurlOpenInNewWindow ) %]
76                             <a href="https://[% BakerTaylorBookstoreURL |html %][% normalized_isbn %]" target="_blank"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% normalized_isbn %]" /></a>
77                         [% ELSE %]
78                             <a href="https://[% BakerTaylorBookstoreURL |html %][% normalized_isbn %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% normalized_isbn %]" /></a>
79                         [% END %]
80                     [% END %]
81                     </div><!-- / #bookcover -->
82
83                     <abbr class="unapi-id" title="koha:biblionumber:[% biblionumber %]"><!-- unAPI --></abbr>
84                     [% IF ( ocoins ) # COinS / Openurl %]
85                         <span class="Z3988" title="[% ocoins %]"></span>
86                     [% END %]
87
88                     <div id="views">
89                         <span class="view"><span id="Normalview">Normal view</span></span>
90                         <span class="view"><a id="MARCview" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% biblionumber %]">MARC view</a></span>
91                         [% IF ( ISBD ) %]<span class="view"><a id="ISBDview" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% biblionumber %]">ISBD view</a></span>[% END %]
92                     </div>
93                     [% IF ( OPACXSLTDetailsDisplay ) %]
94                         [% XSLTBloc %]
95                     [% ELSE %]
96                         <h1 class="title">[% title |html %][% IF ( subtitle ) %] <span class="subtitle">[% FOREACH subtitl IN subtitle %][% subtitl.subfield |html %] [% END %]</span>[% END %]</h1>
97                         [% IF ( author ) %]<h5 class="author">by <a href="/cgi-bin/koha/opac-search.pl?q=au:[% author |url %]">[% author |html %]</a></h5>[% END %]
98
99                         <span class="results_summary">[% UNLESS ( item_level_itypes ) %]
100                             [
101                             [% IF ( description ) %]
102                                 [% description %]
103                             [% ELSE %]
104                                 [% itemtype %]
105                             [% END %]
106                             ] [% END %]
107                             [% IF ( unititle ) %], [% unititle %][% END %]
108                         </span>
109
110                         [% IF ( MARCAUTHORS ) %]
111                             <div class="results_summary">
112                                 <span class="label">Additional authors:</span>
113                                 [% IF OPACPopupAuthorsSearch %]
114                                     <!-- Author search term selection modal -->
115                                     <div id="authorSearch" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="authorSearchLabel" aria-hidden="true">
116                                         <div class="modal-header">
117                                             <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
118                                             <h3 id="authorSearchLabel">Select the item(s) to search</h3>
119                                         </div>
120                                         <div class="modal-body">
121                                             <input type="checkbox" onchange="checkAll(this, '#authorsList')" /> <b>All</b>
122                                             <ul id="authorsList">
123                                                 [% FOREACH MARCAUTHOR IN MARCAUTHORS %]
124                                                     <li>
125                                                         [% IF (MARCAUTHOR.authoritylink) %]
126                                                             <input type="checkbox" name="checkbox"
127                                                                 id="author_[% loop.count %]"
128                                                                 onclick="makeAuthorRequest()"
129                                                                 value="an:[% MARCAUTHOR.authoritylink %]" />
130                                                         [% ELSE %]
131                                                             <input type="checkbox" name="checkbox"
132                                                                 id="author_[% loop.count %]"
133                                                                 onclick="makeAuthorRequest()"
134                                                                 value="au,wrdl:[% FOREACH SUBFIELD IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %][% SUBFIELD.value |url %][% UNLESS (loop.last) %]+[% END %][% END %]" />
135                                                         [% END %]
136                                                         <label for="author_[% loop.count %]">
137                                                             [% FOREACH SUBFIELD IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %]
138                                                                 [% SUBFIELD.value %]
139                                                             [% END %]
140                                                         </label>
141                                                     </li>
142                                                 [% END # /FOREACH MARCAUTHORS %]
143                                             </ul>
144                                         </div>
145                                         <div class="modal-footer">
146                                             <a href="#" class="btn btn-primary">Search</a>
147                                             <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
148                                         </div>
149                                     </div>
150                                 [% END # /OPACPopupAuthorsSearch %]
151
152                                 [% FOREACH MARCAUTHOR IN MARCAUTHORS %]
153                                     [% authorsloop = loop %]
154                                     [% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %]
155                                         [% MARCAUTHOR_SUBFIELDS_LOO.separator %]
156                                         <a role="button" data-toggle="modal" title="‡[% MARCAUTHOR_SUBFIELDS_LOO.code %] [% MARCAUTHOR_SUBFIELDS_LOO.value %]"
157                                             class="showauthors" data-count="[% authorsloop.count %]"
158                                             href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link_loo IN MARCAUTHOR_SUBFIELDS_LOO.link_loop %][% link_loo.operator |url %][% link_loo.limit |url %]:[% link_loo.link |url %][% END %]#authorSearch">[% MARCAUTHOR_SUBFIELDS_LOO.value %]</a>
159                                     [% END %]
160                                     [% IF (MARCAUTHOR.authoritylink) %]
161                                         <a class='authlink' href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% MARCAUTHOR.authoritylink %]"><img style="vertical-align:middle" height="15" width="15" src="[% interface %]/[% theme %]/images/filefind.png"></a>
162                                     [% END %]
163                                     [% UNLESS ( loop.last ) %]|[% END %]
164                                 [% END # /FOREACH MARCAUTHORS %]
165                             </div>
166                         [% END # IF MARCAUTHORS %]
167
168                         [% IF ( MARCSERIES ) %]
169                             <span class="results_summary series"><span class="label">Series:</span>
170                                 [% FOREACH MARCSERIE IN MARCSERIES %]
171                                     [% FOREACH MARCSERIES_SUBFIELDS_LOO IN MARCSERIE.MARCSERIES_SUBFIELDS_LOOP %]
172                                         [% IF ( MARCSERIES_SUBFIELDS_LOO.value ) %]
173                                             <a href="/cgi-bin/koha/opac-search.pl?q=se:[% MARCSERIES_SUBFIELDS_LOO.value |url %]">[% MARCSERIES_SUBFIELDS_LOO.value %]</a>
174                                         [% END %]
175                                         [% IF ( MARCSERIES_SUBFIELDS_LOO.volumenum ) %]
176                                             . [% MARCSERIES_SUBFIELDS_LOO.volumenum %]
177                                         [% END %]
178                                     [% END %]
179                                     [% UNLESS ( loop.last ) %]|[% END %]
180                                 [% END # / FOREACH MARCSERIES %]
181                             </span>
182                         [% END # /MARCSERIES %]
183
184                         [% IF ( editionstatement ) %]
185                             <span class="results_summary edition"><span class="label">Edition statement:</span>[% editionstatement %][% IF ( editionresponsibility ) %]/[% editionresponsibility %][% END %]</span>
186                         [% END %]
187                         [% IF ( publishercode ) %]
188                             <span class="results_summary publisher"><span class="label">Published by :</span>
189                                 <a href="/cgi-bin/koha/opac-search.pl?q=pb:[% publishercode |url %] ">
190                                     [% publishercode |html %]
191                                 </a> [% IF ( place ) %]([% place %])[% END %] [% IF ( publicationyear ) %], [% publicationyear %][% END %]
192                             </span>
193                         [% END %]
194
195                         [% IF ( pages ) %]
196                             <span class="results_summary physical"><span class="label">Physical details:</span> [% pages %] [% illus %] [% size %]</span>
197                         [% END %]
198
199                         [% IF ( MARCISBNS ) %]
200                             <span class="results_summary isbn"><span class="label">ISBN:</span>[% FOREACH MARCISBN IN MARCISBNS %][% MARCISBN.marcisbn %][% IF ( loop.last ) %].[% ELSE %]; [% END %][% END %]</span>
201                         [% ELSE %]
202                             [% IF ( normalized_isbn ) %]
203                                 <span class="results_summary isbn"><span class="label">ISBN: </span>[% normalized_isbn %]</span>
204                             [% END %]
205                         [% END %]
206
207                         [% IF ( issn ) %]
208                             <span class="results_summary issn"><span class="label">ISSN:</span>[% issn %]</span>
209                         [% END %]
210
211                         [% IF ( collectiontitle ) %]
212                             <span class="results_summary collection"><span class="label">Collection: </span>
213                                 [% collectiontitle %]
214                                 [% IF ( collectionissn ) %], ISSN [% collectionissn %]    [% END %]
215                                 [% IF ( collectionvolume ) %]; [% collectionvolume %] [% END %]
216
217                             </span>
218                         [% END %]
219
220                         [% IF ( unititles ) %]
221                             <span class="results_summary unititle"><span class="label">Uniform titles:</span>
222                                 [% FOREACH unititle IN unititles %]
223                                     [% unititle.unititle %] ;
224                                 [% END %]
225                             </span>
226                         [% END %]
227
228                         [% IF ( MARCSUBJCTS ) %]
229                             <div class="results_summary subject">
230                                 <span class="label">Subject(s):</span>
231
232                                 [% IF OPACPopupAuthorsSearch %]
233                                     <!-- Search term selection modal -->
234                                     <div id="subjectSearch" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="subjectSearchLabel" aria-hidden="true">
235                                         <div class="modal-header">
236                                             <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
237                                             <h3 id="subjectSearchLabel">Select the term(s) to search</h3>
238                                         </div>
239                                         <div id="subjectsList" class="modal-body">
240                                             <input type="checkbox" id="all_subjects" onchange="checkAll(this, '#subjectsList')" />
241                                             <label for="all_subjects">
242                                                 <b>All</b>
243                                             </label>
244                                             [% FOREACH MARCSUBJCT IN MARCSUBJCTS %]
245                                                 [% subjectsloop = loop %]
246                                                 [% IF MARCSUBJCT.authoritylink %]
247                                                     <ul id="subjectsList[% loop.count %]" data-authid="[% MARCSUBJCT.authoritylink %]">
248                                                 [% ELSE %]
249                                                     <ul id="subjectsList[% loop.count %]">
250                                                 [% END %]
251                                                 [% FOREACH SUBFIELD IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %]
252                                                     <li>
253                                                         <input type="checkbox" onclick="makeSubjectRequest()" name="checkbox" id="subject_[% subjectsloop.count %]_[% loop.count %]" value="su,wrdl:[% SUBFIELD.value |url %]" />
254                                                         <label for="subject_[% subjectsloop.count %]_[% loop.count %]">
255                                                             [% SUBFIELD.value %]
256                                                         </label>
257                                                     </li>
258                                                 [% END %]
259                                                 </ul>
260                                             [% END %]
261                                         </div>
262                                         <div class="modal-footer">
263                                             <a href="#" id="validSubjectSearch" class="btn btn-primary">Search</a>
264                                             <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
265                                         </div>
266                                     </div>
267                                 [% END # /OPACPopupAuthorsSearch%]
268
269                                 [% FOREACH MARCSUBJCT IN MARCSUBJCTS %]
270                                     [% subjectsloop = loop %]
271                                     [% FOREACH SUBFIELD IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %]
272                                         [% SUBFIELD.separator %]
273                                         <a role="button" data-toggle="modal" title="$[% SUBFIELD.code %] [% SUBFIELD.value %]" href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link_loo IN SUBFIELD.link_loop %][% link_loo.operator |url %][% link_loo.limit |url %]:[% link_loo.link |url %][% END %]#subjectSearch" onclick="showSubjects(this, [% subjectsloop.count %], [% loop.count %]); return false;">[% SUBFIELD.value %]</a>
274                                     [% END %]
275                                     [% IF (MARCSUBJCT.authoritylink) %]
276                                         <a class="authlink" href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% MARCSUBJCT.authoritylink %]"><img style="vertical-align:middle" height="15" width="15" src="[% interface %]/[% theme %]/images/filefind.png" /></a>
277                                     [% END %]
278                                     [% UNLESS ( loop.last ) %] | [% END %]
279                                 [% END # / FOREACH MARCSUBJCTS %]
280                             </div>
281                         [% ELSE # /IF MARCSUBJCTS %]
282                             [% IF ( subjects ) %]<span class="results_summary"><span class="label">Subject(s):</span> [% FOREACH subject IN subjects %]<a href="/cgi-bin/koha/opac-search.pl?q=su:[% subject.subject |url %]">[% subject.subject %]</a> | [% END %]</span>[% END %]
283                         [% END %]
284
285                         [% IF ( copyrightdate ) %]
286                             <span class="results_summary year"><span class="label">Year: </span>[% copyrightdate %]</span>
287                         [% END %]
288
289                         [% UNLESS ( item_level_itypes ) %]
290                             [% IF ( imgeurl ) %]
291                                 <img src="[% imageurl %]" alt="" />
292                             [% END %]
293                             <span class="results_summary itemtype"><span class="label">Item type: </span>
294                                 [% IF ( description ) %]
295                                     [% description %]
296                                 [% ELSE %]
297                                     [% itemtype %]
298                                 [% END %]
299                             </span>
300                         [% END %]
301
302                         [% IF ( MARCURLS ) %]
303                             <div class="results_summary online_resources"><span class="label">Online resources:</span>
304                                 <ul>
305                                     [% FOREACH MARCurl IN MARCURLS %]
306                                         <li>[% IF ( MARCurl.part ) %][% MARCurl.part %]<br />[% END %]
307
308                                         [% IF ( OPACurlOpenInNewWindow ) %]
309                                             [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
310                                                 <a href="/cgi-bin/koha/tracklinks.pl?uri=[% MARCurl.MARCURL |url%]&amp;biblionumber=[% biblionumber | url %]" title="[% MARCurl.MARCURL %]" target="_blank">
311                                             [% ELSE %]
312                                                 <a href="[% MARCurl.MARCURL %]" title="[% MARCurl.MARCURL %]" target="_blank">
313                                             [% END %]
314                                         [% ELSE %]
315                                             [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
316                                                 <a href="/cgi-bin/koha/tracklinks.pl?uri=[% MARCurl.MARCURL |url%]&amp;biblionumber=[% biblionumber | url %]" title="[% MARCurl.MARCURL %]">
317                                             [% ELSE %]
318                                                 <a href="[% MARCurl.MARCURL %]" title="[% MARCurl.MARCURL %]">
319                                             [% END %]
320                                         [% END %]
321
322                                         [% MARCurl.linktext %]</a>
323                                             [% IF ( MARCurl.notes ) %]
324                                                 <ul>
325                                                     [% FOREACH note IN MARCurl.notes %]
326                                                         <li>[% note.note %]</li>
327                                                     [% END %]
328                                                 </ul>
329                                             [% END %]
330                                         </li>
331                                     [% END # /FOREACH MARCURLS %]
332                                 </ul>
333                             </div>
334                         [% END # / IF MARCURLS %]
335                     [% END # / IF OPACXSLTDetailsDisplay %]
336
337                     [% IF ( AuthorisedValueImages && authorised_value_images ) %]
338                         <div class="authorised_value_images">
339                             [% FOREACH authorised_value_image IN authorised_value_images %]
340                                 <img src="[% authorised_value_image.imageurl %]" alt="[% authorised_value_image.label %]" title="[% authorised_value_image.label %]" />
341                             [% END %]
342                         </div>
343                     [% END # / AuthorisedValueImages && authorised_value_images %]
344
345                     <!-- This puts the LTFL reviews in, and if TabbedView is not set, puts the remaining content above the Tabs instead of in them -->
346                     [% IF ( LibraryThingForLibrariesID ) %]
347                         [% UNLESS ( LibraryThingForLibrariesTabbedView ) %]
348                             <div class="results_summary"><div id="ltfl_related" class="ltfl"></div></div>
349                             <div class="results_summary"><div id="ltfl_similars" class="ltfl"></div></div>
350                             <div class="results_summary"><div id="ltfl_tagbrowse" class="ltfl"></div></div>
351                         [% END %]
352                         <span class="results_summary">
353                             <span class="label">Reviews from LibraryThing.com:</span>
354                             <span style="display: block;" class="ltfl_reviews"></span>
355                         </span>
356                     [% END # / LibraryThingForLibrariesID %]
357
358                     <!--This grabs all of the lists a bib record appears in -->
359                     [% IF ( GetShelves ) %]
360                         <span class="results_summary lists"><span class="label">List(s) this item appears in: </span>
361                         [% FOREACH GetShelve IN GetShelves %]
362                             <a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% GetShelve.shelfnumber %]">[% GetShelve.shelfname %]</a>
363                             [% IF ( loop.last ) %][% ELSE %]|[% END %]
364                         [% END %]
365                         </span>
366                     [% END # / GetShelves %]
367
368                     [% IF ( TagsShowEnabled ) %]
369                         <div class="results_summary tags">
370                         [% IF ( TagLoop ) %]
371                             <span class="label">Tags from this library:</span>
372                             <ul id="tagslist">
373                                 [% FOREACH TagLoo IN TagLoop %]
374                                     <li><a href="/cgi-bin/koha/opac-search.pl?tag=[% TagLoo.term |url %]&amp;q=[% TagLoo.term |url %]">[% TagLoo.term |html %]</a> <span class="weight">([% TagLoo.weight_total %])</span>
375                                     [% IF ( loop.last ) %][% ELSE %], [% END %]
376                                     </li>
377                                 [% END %]
378                             </ul>
379                         [% ELSE %]
380                             <span class="label">Tags from this library:</span> <span class="notags">No tags from this library for this title.</span>
381                         [% END %]
382                         [% IF ( TagsInputEnabled ) %] <a class="tag_add" id="tag_add[% biblionumber %]" href="#">Add tag(s)</a> [% END %]
383                         </div>
384                     [% END # /IF TagsShowEnabled %]
385
386                     [% IF ( TagsInputEnabled ) %]
387                       <div class="results_summary tagsinput">
388                             [% IF ( loggedinusername ) %]
389                                 <form id="tagform[% biblionumber %]" method="post" action="/cgi-bin/koha/opac-tags.pl" style="display:none;">
390                                     <label for="newtag[% biblionumber %]">New tag(s), separated by a comma:</label>
391                                     <input name="newtag[% biblionumber %]" id="newtag[% biblionumber %]" maxlength="100" type="text"/>
392                                     <input name="tagbutton" class="btn btn-small tagbutton" title="[% biblionumber %]" type="submit" value="Add" />
393                                     <a class="cancel_tag_add" id="cancel[% biblionumber %]" href="#">(done)</a>
394                                 </form>
395                                 <span id="newtag[% biblionumber %]_status" class="tagstatus" style="display:none;">
396                                     Tag status here.
397                                 </span>
398                             [% ELSE %]
399                                 <span id="login4tags">Log in to add tags.</span>
400                             [% END %]
401                         </div>
402                     [% END # / IF TagsInputEnabled %]
403
404                     [% IF ( SyndeticsEnabled ) %]
405                         [% IF ( SyndeticsSeries && SyndeticsSERIES1Exists ) %]
406                             <span class="results_summary">
407                                 <span class="label">Series information:</span>
408                                 [% IF ( using_https ) %]
409                                     <a target="_blank" href="https://secure.syndetics.com/ffseries.aspx?isbn=[% normalized_isbn %]&amp;type=series&amp;num=1&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]">Click to open in new window</a>
410                                 [% ELSE %]
411                                     <a target="_blank" href="http://www.syndetics.com/ffseries.aspx?isbn=[% normalized_isbn %]&amp;type=series&amp;num=1&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]">Click to open in new window</a>
412                                 [% END %]
413                             </span>
414                         [% END # / IF SyndeticsSeries && SyndeticsSERIES1Exists%]
415                         [% IF ( SyndeticsAVPROFILEExists ) %]
416                             <span class="results_summary">
417                                 <span class="label">Audiovisual profile:</span>
418                                 [% IF ( using_https ) %]
419                                     <a target="_blank" href="https://secure.syndetics.com/index.aspx?isbn=[% normalized_isbn %]/avprofile.html&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]&amp;type=xw10">Click to open in new window</a>
420                                 [% ELSE %]
421                                     <a target="_blank" href="http://www.syndetics.com/index.aspx?isbn=[% normalized_isbn %]/avprofile.html&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]&amp;type=xw10">Click to open in new window</a>
422                                 [% END %]
423                             </span>
424                         [% END # / IF SyndeticsAVPROFILEExists %]
425
426                         [% IF ( SyndeticsFICTIONExists ) %]
427                             <span class="results_summary">
428                             <span class="label">Fiction notes:</span>
429                                 [% IF ( using_https ) %]
430                                     <a target="_blank" href="https://secure.syndetics.com/index.aspx?isbn=[% normalized_isbn %]/fiction.html&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]&amp;type=xw10">Click to open in new window</a>
431                                 [% ELSE %]
432                                     <a target="_blank" href="http://www.syndetics.com/index.aspx?isbn=[% normalized_isbn %]/fiction.html&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]&amp;type=xw10">Click to open in new window</a>
433                                 [% END %]
434                             </span>
435                         [% END # / IF SyndeticsFICTIONExists %]
436
437                         [% IF ( SyndeticsAwards && SyndeticsAWARDS1Exists ) %]
438                             <span class="results_summary">
439                                 <span class="label">Awards:</span>
440                                 [% IF ( using_https ) %]
441                                     <a target="_blank" href="https://secure.syndetics.com/ffawards.aspx?isbn=[% normalized_isbn %]&amp;type=awards&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]">Click to open in new window</a>
442                                 [% ELSE %]
443                                     <a target="_blank" href="http://www.syndetics.com/ffawards.aspx?isbn=[% normalized_isbn %]&amp;type=awards&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]">Click to open in new window</a>
444                                 [% END %]
445                             </span>
446                         [% END # / IF SyndeticsAwards && SyndeticsAWARDS1Exists %]
447                     [% END # / IF SyndeticsEnabled%]
448
449                     [% IF ( OpacStarRatings != 'disable' ) %]
450                         <form method="post" action="/cgi-bin/koha/opac-ratings.pl">
451                             <div class="results_summary ratings">
452
453                                 [% FOREACH i  IN [ 1 2 3 4 5  ] %]
454                                     [% IF rating_avg == i && borrowernumber %]
455                                         <input class="auto-submit-star" type="radio" name="rating"  value="[% i %]"  checked="checked" />
456                                     [% ELSIF rating_avg == i %]
457                                         <input class="auto-submit-star" type="radio" name="rating" value="[% i %]" checked="checked" disabled="disabled" />
458                                     [% ELSIF borrowernumber  %]
459                                         <input class="auto-submit-star" type="radio" name="rating" value="[% i %]" />
460                                     [% ELSE   %]
461                                         <input class="auto-submit-star" type="radio" name="rating" value="[% i %]" disabled="disabled" />
462                                     [% END %]
463                                 [% END %]
464
465                                 <!-- define some hidden vars for ratings -->
466
467                                 <input  type="hidden" name='biblionumber'  value="[% biblionumber %]" />
468                                 <input  type="hidden" name='borrowernumber'  value="[% borrowernumber %]" />
469                                 <input  type="hidden" name='rating_value' id='rating_value' value="[% rating_value %]" />
470                                 <input  type="hidden" name='rating_total' id='rating_total' value="[% rating_total %]" />
471                                 <input  type="hidden" name='rating_avg_int' id='rating_avg_int' value="[% rating_avg_int %]" />
472
473                                 [% UNLESS ( rating_readonly ) %]&nbsp;  <input name="rate_button" type="submit" value="Rate me" />[% END %]&nbsp;
474
475                                 [% IF ( rating_value ) %]
476                                     <span id="rating_value_text">your rating: [% rating_value %], </span>
477                                 [% ELSE %]
478                                     <span id="rating_value_text"></span>
479                                 [% END %]
480
481                                 <span id="rating_text">average rating: [% rating_avg_int %] ([% rating_total %] votes)</span>
482                             </div>
483                         </form>
484                     [% END # / IF OpacStarRatings != 'disable' %]
485
486                     [% IF ( BakerTaylorContentURL ) %]
487                         <span class="results_summary">
488                         <span class="label">Enhanced content: </span>
489                               [% IF ( OPACurlOpenInNewWindow ) %]<a href="[% BakerTaylorContentURL |html %]" target="_blank">Content Cafe</a>[% ELSE %]<a href="[% BakerTaylorContentURL |html %]">Content Cafe</a>[% END %]
490                         </span>
491                     [% END # / IF BakerTaylorContentURL %]
492
493                     [% IF ( NovelistSelectProfile ) %]
494                         [% IF ( NovelistSelectView == 'above') %]
495                             <span class="results_summary">
496                             <span class="label">Novelist Select: </span>
497                             <div data-novelist-novelistselect=[% normalized_isbn %]></div>
498                             </span>
499                         [% END %]
500                     [% END # / IF NovelistSelectProfile %]
501
502                     [% IF ( Babeltheque ) %]
503                         <input type="hidden" name="BW_id_isbn" id="BW_id_isbn" value="[% normalized_isbn %]"/>
504                         <div id="BW_notes"></div>
505                         <div id="BW_critiques"></div>
506                         <div id="BW_critiques_pro"></div>
507                         <div id="BW_citations"></div>
508                     [% END # / IF Babeltheque%]
509
510                 </div> <!-- / #catalogue_detail_biblio -->
511
512                 <div id="bibliodescriptions" class="toptabs">
513
514                     <ul>
515                         [% IF ( defaulttab == 'holdings' ) %]
516                             <li id="tab_holdings" class="ui-tabs-active">
517                         [% ELSE %]
518                             <li id="tab_holdings">
519                         [% END %]
520                             <a href="#holdings">[% IF SeparateHoldings %][% LoginBranchname %] holdings[% ELSE %]Holdings[% END %] [% UNLESS too_many_items %] ( [% itemloop.size || 0 %] )[% END %]</a>
521                         </li>
522                         [% IF (SeparateHoldings) %]
523                             <li><a href="#otherholdings">Other holdings ( [% otheritemloop.size || 0 %] )</a></li>
524                         [% END %]
525                         [% IF ( MARCNOTES || notes || ( SyndeticsEnabled && SyndeticsSummary && SYNDETICS_SUMMARY )) %]
526                             <li id="tab_descriptions"> <a href="#descriptions">Title notes</a></li>
527                         [% END %]
528                         [% IF ( SYNDETICS_TOC ) %]
529                             <li id="tab_toc"> <a href="#toc">TOC</a></li>
530                         [% END %]
531                         [% IF ( SyndeticsEnabled ) %]
532                             [% IF ( SyndeticsExcerpt && SYNDETICS_EXCERPT ) %]
533                                 <li id="tab_excerpt"> <a href="#excerpt">Excerpt</a></li>
534                             [% END %]
535                             [% IF ( SyndeticsReviews && SYNDETICS_REVIEWS ) %]
536                                 <li id="tab_reviews"> <a href="#reviews">Reviews</a></li>
537                                 <li id="tab_LTFLreviews">
538                                     [% IF ( using_https ) %]
539                                         <script src="https://www.librarything.com/forlibraries/widget.js?id=[% LibraryThingForLibrariesID %]" type="text/javascript"></script>
540                                         <noscript>This page contains enriched content visible when JavaScript is enabled or by clicking <a href="https://www.librarything.com/forlibraries/noscript.php?id=99-274208589&amp;accessibility=1">here</a>.</noscript>
541                                     [% ELSE %]
542                                         <script src="http://www.librarything.com/forlibraries/widget.js?id=[% LibraryThingForLibrariesID %]" type="text/javascript"></script>
543                                         <noscript>This page contains enriched content visible when JavaScript is enabled or by clicking <a href="http://www.librarything.com/forlibraries/noscript.php?id=99-274208589&amp;accessibility=1">here</a>.</noscript>
544                                     [% END %]
545                                 </li>
546                             [% END %]
547                             [% IF ( SyndeticsAuthorNotes && SYNDETICS_ANOTES ) %]
548                                 <li id="tab_anotes"> <a href="#anotes">About the author</a></li>
549                             [% END %]
550                         [% END # / IF SyndeticsEnabled %]
551
552                         [% IF ( LibraryThingForLibrariesID && LibraryThingForLibrariesTabbedView ) %]
553                             <li id="tab_LFTLSimilarItems"> <a href="#LFTLSimilarItems">Similar items</a></li>
554                             <li id="tab_LTFLTagBrowse"> <a href="#LTFLTagBrowse">Tag browser</a></li>
555                         [% END %]
556
557                         [% IF ( subscriptionsnumber ) %]
558                             [% IF ( defaulttab == 'subscriptions' ) %]<li id="tab_subscriptions" class="ui-tabs-active">[% ELSE %]<li id="tab_subscriptions">[% END %]
559                                 <a href="#subscriptions">Subscriptions</a>
560                             </li>
561                         [% END %]
562
563                         [% IF Koha.Preference( 'reviewson' ) == 1 %]
564                             <li id="tab_comments"><a href="#comments">Comments ( [% reviews.size || 0 %] )</a></li>
565                         [% END %]
566
567                         [% IF ( NovelistSelectProfile ) %]
568                             [% IF ( NovelistSelectView == 'tab') %]
569                                 <li id="tab_NovelistSelect"> <a href="#NovelistSelect">Novelist Select</a></li>
570                             [% END %]
571                         [% END %]
572
573                         [% IF ( OPACFRBRizeEditions && XISBNS ) %]
574                             <li id="tab_editions"><a href="#editions">Editions</a></li>
575                         [% END %]
576
577                         [% IF ( serialcollection ) %]
578                             [% IF ( defaulttab == 'serialcollection' ) %]<li id="tab_serialcollection" class="ui-tabs-active">[% ELSE %]<li id="tab_serialcollection">[% END %]
579                                 <a href="#serialcollection">Serial collection</a>
580                             </li>
581                         [% END %]
582
583                         [% IF ( OPACLocalCoverImages && localimages.size ) %]
584                             <li id="tab_images"><a href="#images">Images</a></li>
585                         [% END %]
586
587                         [% IF ( HTML5MediaEnabled && HTML5MediaSets ) %]
588                             <li id="tab_html5media"><a href="#html5media">Play media</a></li>
589                         [% END %]
590
591                         [% IF ( IDreamBooksReviews ) %]
592                             <li id='tab_idb_critic_reviews' style="display:none;"><a href='#idb_critic_reviews'>Book reviews by critics ( XXX )</a></li>
593                         [% END %]
594                     </ul>
595
596                     [% IF ( serialcollection ) %]
597                         <div id="serialcollection">
598                             <table id="serialcollectiont" class="table table-bordered table-striped">
599                             <thead>
600                                 <tr>
601                                     <th id="serial_library">Library</th>
602                                     <th id="serial_collection">Serial collection</th>
603                                     <th id="serial_itemcallnumber">Item call number</th>
604                                 </tr>
605                             </thead>
606                             <tbody>
607                             [% FOREACH serialcollection IN serialcollections %]
608                                 <tr>
609                                 <td>[% serialcollection.branch %]</td>
610                                 <td>[% serialcollection.text %]</td>
611                                 <td>[% serialcollection.itemcallnumber %]</td>
612                                 </tr>
613                             [% END %]
614                             </tbody>
615                             </table>
616                         </div>
617                     [% END # / IF serialcollection %]
618
619
620                     <div id="holdings">
621                         [% IF too_many_items %]
622                             <p>This record has many physical items ([% items_count %]). <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]&amp;viewallitems=1">Click here to view them all.</a></p>
623                         [% ELSIF ( itemloop.size ) %]
624                             [% INCLUDE items_table items=itemloop tab="holdings" %]
625
626                             [% IF holds_count.defined || priority %]
627                                 <div id="bib_holds">
628                                     [% IF holds_count.defined %]
629                                         Total holds: [% holds_count %]
630                                     [% END %]
631                                     [% IF priority %]
632                                         [% IF holds_count.defined %]
633                                             (priority [% priority %])
634                                         [% ELSE %]
635                                             Overall queue priority: [% priority %]
636                                         [% END %]
637                                     [% END %]
638                                 </div>
639                             [% END %]
640                         [% ELSE %]
641                             [% IF ( ALTERNATEHOLDINGS ) %]
642                                 [% FOREACH ALTERNATEHOLDING IN ALTERNATEHOLDINGS %]
643                                     <div id="alternateholdings"><span class="holdings_label">Holdings:</span> [% ALTERNATEHOLDING.holding %]</div>
644                                 [% END %]
645                             [% ELSE %]
646                                 <div id="noitems">No physical items for this record</div>
647                             [% END %]
648                         [% END # IF itemloop.size %]
649                         [% PROCESS 'shelfbrowser.inc' %]
650                         [% INCLUDE shelfbrowser tab='holdings' %]
651                         <br style="clear:both;" />
652                     </div> <!-- / #holdings -->
653
654                     [% IF (SeparateHoldings) %]
655                         <div id="otherholdings">
656                             [% IF (otheritemloop.size) %]
657                                 [% INCLUDE items_table items=otheritemloop tab="otherholdings" %]
658                             [% ELSE %]
659                                 No other items.
660                             [% END %]
661                             [% INCLUDE shelfbrowser tab='otherholdings' %]
662                         </div>
663                     [% END # / SeparateHoldings %]
664
665                     [% IF ( MARCNOTES || notes || ( SyndeticsEnabled && SyndeticsSummary && SYNDETICS_SUMMARY )) %]
666                         <div id="descriptions">
667                             <div class="content_set">
668
669                             [% IF ( SyndeticsEnabled && SyndeticsSummary && SYNDETICS_SUMMARY ) %]
670                                 <h4>Enhanced descriptions from Syndetics:</h4>
671                                 <p>[% SYNDETICS_SUMMARY %]</p>
672                             [% END %]
673
674                             [% IF ( MARCNOTES ) %]
675                                 <div id="marcnotes">
676                                 [% FOREACH MARCNOTE IN MARCNOTES %]
677                                     <p>[% MARCNOTE.marcnote FILTER html_line_break %]</p>
678                                 [% END %]
679                                 </div>
680                             [% ELSE %]
681                                 [% IF ( notes ) %]
682                                     <p>[% notes %]</p>
683                                 [% END %]
684                             [% END %]
685
686                             </div>
687                         </div> <!-- / #descriptions -->
688                     [% END # / IF MARCNOTES || notes %]
689
690                     [% IF ( SyndeticsEnabled ) %]
691                         [% IF ( SyndeticsTOC && SYNDETICS_TOC ) %]
692                             <div id="toc">
693                                 <div class="content_set">
694                                     <h3>Table of contents provided by Syndetics</h3>
695                                         <ul>
696                                             [% FOREACH SYNDETICS_TO IN SYNDETICS_TOC %]
697                                                 [% IF ( SYNDETICS_TO.p ) %]
698                                                 <li><b>[% SYNDETICS_TO.l %] [% SYNDETICS_TO.t %]</b>[% IF ( SYNDETICS_TO.p ) %] ([% SYNDETICS_TO.p %])[% END %]</li>
699                                                 [% END %]
700                                             [% END %]
701                                         </ul>
702                                 </div>
703                             </div>
704                         [% END # / IF SyndeticsTOC && SYNDETICS_TOC %]
705
706                         [% IF ( SyndeticsExcerpt && SYNDETICS_EXCERPT ) %]
707                             <div id="excerpt">
708                                 <div class="content_set">
709                                     <h3>Excerpt provided by Syndetics</h3>
710                                     [% SYNDETICS_EXCERPT %]
711                                 </div>
712                             </div>
713                         [% END # / IF SyndeticsExcerpt && SYNDETICS_EXCERPT %]
714
715                         [% IF ( SyndeticsReviews && SYNDETICS_REVIEWS ) %]
716                             <div id="reviews">
717                                 <div class="content_set">
718                                     <h3>Reviews provided by Syndetics</h3>
719                                     [% FOREACH SYNDETICS_REVIEW IN SYNDETICS_REVIEWS %]
720                                         [% IF ( SYNDETICS_REVIEW.title ) %]
721                                             <h4>[% SYNDETICS_REVIEW.title %]</h4>
722                                                 [% FOREACH review IN SYNDETICS_REVIEW.reviews %]
723
724                                                     [% IF ( review.content ) %]
725                                                         [% review.content %]
726                                                     [% END %]
727
728                                                 [% END %]
729                                         [% END %]
730                                     [% END %]
731                                 </div>
732                             </div>
733                         [% END # / IF SyndeticsReviews && SYNDETICS_REVIEWS %]
734
735                         [% IF ( SyndeticsAuthorNotes && SYNDETICS_ANOTES ) %]
736                             <div id="anotes">
737                                 <div class="content_set">
738                                     <h3>Author notes provided by Syndetics</h3>
739                                     [% FOREACH SYNDETICS_ANOTE IN SYNDETICS_ANOTES %]
740                                         [% IF ( SYNDETICS_ANOTE.content ) %]
741                                             [% SYNDETICS_ANOTE.content %]
742                                         [% END %]
743                                     [% END %]
744                                 </div>
745                             </div>
746                         [% END # / IF SyndeticsReviews && SYNDETICS_REVIEWS %]
747                     [% END # / IF SyndeticsEnabled %]
748
749                     [% IF ( NovelistSelectProfile && NovelistSelectView == 'tab') %]
750                        <div id="NovelistSelect">
751                             <div data-novelist-novelistselect=[% normalized_isbn %]></div>
752                        </div>
753                     [% END # / IF NovelistSelectProfile && NovelistSelectView == 'tab' %]
754
755                     [% IF ( subscriptionsnumber ) %]
756                         <div id="subscriptions">
757                             <h2>This is a serial</h2>
758                             <p>There are [% subscriptionsnumber %] subscription(s) associated with this title.</p>
759                             [% FOREACH subscription IN subscriptions %]
760                                 [% IF ( subscription.branchname ) %]
761                                     <h3>At library: [% subscription.branchname %]</h3>
762                                 [% ELSE %]
763                                     [% IF ( subscription.branchcode ) %]
764                                         <h3>At library: [% subscription.branchcode %]</h3>
765                                     [% END %]
766                                 [% END %]
767                                 [% IF ( subscription.closed ) %]
768                                     <p>This subscription is closed.</p>
769                                 [% END %]
770                                 <span style="display:none;"> [% IF ( subscription.callnumber ) %]<p>Call number: [% subscription.callnumber %]</p>[% END %]</span>
771                                 [% IF ( subscription.subscriptionnotes ) %]
772                                     <p>[% subscription.subscriptionnotes FILTER html_line_break %] </p>
773                                 [% END %]
774                                 <p>Subscription from: [% subscription.histstartdate | $KohaDates %] to:[% IF ( subscription.histenddate ) %] [% subscription.histenddate | $KohaDates %] [% ELSE %] now (current)[% END %]</p>
775                                 [% IF ( subscription.missinglist ) %]
776                                     <p>Missing issues: [% subscription.missinglist %] </p>
777                                 [% END %]
778                                 [% IF ( subscription.opacnote ) %]
779                                     <p>[% subscription.opacnote FILTER html_line_break %]</p>
780                                 [% END %]
781                                 [% IF ( subscription.callnumber ) %]
782                                   <p>Call number: [% subscription.callnumber %]</p>
783                                 [% END %]
784                                 [% IF ( subscription.latestserials ) %]
785                                     <p> The [% subscription.opacdisplaycount %] latest issues for this subscription:</p>
786                                     <table class="table table-bordered table-striped">
787                                         <tr>
788                                             <th>Issue #</th>
789                                             <th>Date</th>
790                                             <th>Status</th>
791                                             <th>Note</th>
792                                         </tr>
793                                         [% FOREACH latestserial IN subscription.latestserials %]
794                                             <tr>
795                                                 <td>[% latestserial.serialseq %]</td>
796                                                 <td>[% latestserial.planneddate %]</td>
797                                                 <td>
798                                                     [% IF ( latestserial.status1 ) %]
799                                                         Awaited
800                                                     [% ELSE %]
801                                                         [% IF ( latestserial.status2 ) %]
802                                                             Arrived
803                                                         [% ELSE %]
804                                                             [% IF ( latestserial.status3 ) %]
805                                                                 Late
806                                                             [% ELSE %]
807                                                                 [% IF ( latestserial.status4 ) %]
808                                                                     Missing
809                                                                 [% ELSE %]
810                                                                     [% IF ( latestserial.status5 ) %]
811                                                                         Not issued
812                                                                     [% END %]
813                                                                 [% END %]
814                                                             [% END %]
815                                                         [% END %]
816                                                     [% END %]
817                                                 </td>
818                                                 <td>[% latestserial.notes %]</td>
819                                             </tr>
820                                         [% END # / FOREACH latestserials %]
821                                     </table>
822                                 [% END # / IF subscription.latestserials %]
823                             [% END # / FOREACH subscriptions %]
824                             <p><a href="opac-serial-issues.pl?biblionumber=[% biblionumber %]">More details</a></p>
825                         </div> <!-- / #subscriptions -->
826                     [% END # IF subscriptionsnumber %]
827
828                     [% IF ( LibraryThingForLibrariesID && LibraryThingForLibrariesTabbedView ) %]
829                         <!-- Library Thing for Libraries Content -->
830                         <div id="LFTLSimilarItems">
831                             <div class="content_set">
832                                 <!-- Uncommenting this span makes the font smaller in the tab for LTFL -->
833                                 <!-- but breaks Xhtml validation -->
834                                 <!--    <span class="results_summary">-->
835                                 <div id="ltfl_related"></div>
836                                 <div id="ltfl_similars"></div>
837                                 <!--            </span>-->
838                                 </div>
839                                 </div>
840                                 <div id="LTFLTagBrowse">
841                                     <div class="content_set">
842                                         <!-- <span class="results_summary"> -->
843                                         <div id="ltfl_tagbrowse" class="ltfl"></div>
844                                         <!-- </span> -->
845                                     </div>
846                                 </div>
847                     [% END # / IF LibraryThingForLibrariesID && LibraryThingForLibrariesTabbedView %]
848
849                     [% IF Koha.Preference( 'reviewson' ) == 1 %]
850                         <div id="comments">
851                             <div id="newcomment"></div>
852                                 [% IF ( reviews ) %]
853                                     [% FOREACH review IN reviews %]
854                                         [% IF ( review.your_comment ) %]
855                                             <div class="commentline yours" id="c[% review.reviewid %]">
856                                                 [% IF ( review.avatarurl ) %]
857                                                     <img class="avatar" src="[% review.avatarurl %]" height="80" width="80" alt="" />
858                                                 [% END %]
859                                                 <h5>Your comment</h5>
860                                                 <small>[% review.datereviewed | $KohaDates %]</small>
861                                                 <p>
862                                                     [% FILTER html_break %]
863                                                         [% review.review |html %]
864                                                     [% END %]
865                                                     <a href="#" onclick="Dopop('/cgi-bin/koha/opac-review.pl?biblionumber=[% review.biblionumber %]&amp;reviewid=[% review.reviewid %]');">Edit</a>
866                                                 </p>
867                                             </div>
868                                         [% ELSE %]
869                                             <div class="commentline">
870                                                 [% IF ( ShowReviewer != "none" ) %]
871                                                     [% IF ( review.avatarurl ) %]
872                                                         <img class="avatar" src="[% review.avatarurl %]" height="80" width="80" alt="" />
873                                                     [% END %]
874                                                     [% SWITCH ShowReviewer %]
875                                                     [% CASE 'full' %]
876                                                         <h5>Comment by [% review.title %] [% review.firstname %] [% review.surname %]</h5>
877                                                     [% CASE 'first' %]
878                                                         <h5>Comment by [% review.firstname %]</h5>
879                                                     [% CASE 'surname' %]
880                                                         <h5>Comment by [% review.surname %]</h5>
881                                                     [% CASE 'firstandinitial' %]
882                                                         <h5>Comment by [% review.firstname %] [% review.surname|truncate(2,'.') %]</h5>
883                                                     [% CASE 'username' %]
884                                                         <h5>Comment by [% review.userid %]</h5>
885                                                     [% END %]
886                                                     <small>[% review.datereviewed | $KohaDates %]</small>
887                                                 [% ELSIF ( ShowReviewer == "none") %]
888                                                     <h5>Patron comment on [% review.datereviewed | $KohaDates %]</h5>
889                                                 [% END # / IF ShowReviewer != "none"%]
890                                                 <p>
891                                                   [% FILTER html_break %]
892                                                   [% review.review |html %]
893                                                   [% END %]
894                                                 </p>
895                                             </div> <!-- / .commentline -->
896                                         [% END # / IF review.your_comment %]
897                                     [% END # / FOREACH reviews %]
898                                 [% ELSE %]
899                                     <p>There are no comments for this item.</p>
900                                 [% END # / IF reviews %]
901
902                                 [% IF ( loggedinusername ) %]
903                                     [% UNLESS ( loggedincommenter ) %]
904                                        <div id="addcomment"> <a href="#" onclick="Dopop('/cgi-bin/koha/opac-review.pl?biblionumber=[% biblionumber %]'); return false;">
905                                             Post or edit your comments on this item.
906                                         </a></div>
907                                     [% END %]
908                                 [% ELSE %]
909                                     <div id="addcomment"><a href="/cgi-bin/koha/opac-user.pl">Log in to your account</a> to post a comment.</div>
910                                 [% END # / IF loggedinusername %]
911                             </div> <!-- / #comments -->
912                         [% END # / IF reviewson %]
913
914                         [% IF ( OPACFRBRizeEditions && XISBNS ) %]
915                             <div id="editions">
916                                 <h4>Other editions of this work</h4>
917                                 <table class="table table-bordered table-striped">
918                                     [% FOREACH XISBN IN XISBNS %]
919                                         <tr>
920                                             <td>
921                                             [% IF ( OPACAmazonCoverImages ) %]
922                                                 <img src="http://images.amazon.com/images/P/[% XISBN.normalized_isbn %].01._AA75_PU_PU-5_.jpg" alt="" />
923                                             [% END %]
924
925                                             [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
926                                                 [% IF ( XISBN.content_identifier_exists ) %]
927                                                     [% IF ( using_https ) %]
928                                                         <img src="https://secure.syndetics.com/index.aspx?isbn=[% XISBN.browser_normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %][% IF ( XISBN.browser_normalized_upc ) %]&amp;upc=[% XISBN.browser_normalized_upc %][% END %][% IF ( XISBN.browser_normalized_oclc ) %]&amp;oclc=[% XISBN.browser_normalized_oclc %][% END %]&amp;type=xw10" alt="" />
929                                                     [% ELSE %]
930                                                         <img src="http://www.syndetics.com/index.aspx?isbn=[% XISBN.browser_normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %][% IF ( XISBN.browser_normalized_upc ) %]&amp;upc=[% XISBN.browser_normalized_upc %][% END %][% IF ( XISBN.browser_normalized_oclc ) %]&amp;oclc=[% XISBN.browser_normalized_oclc %][% END %]&amp;type=xw10" alt="" />
931                                                     [% END %]
932                                                 [% ELSE %]
933                                                     <span class="no-image">No cover image available</span>
934                                                 [% END # / IF  XISBN.content_identifier_exists %]
935                                             [% END # / IF SyndeticsEnabled && SyndeticsCoverImages %]
936                                             </td>
937
938                                             [% UNLESS ( item_level_itypes ) %]
939                                                 <td>[% XISBN.description %]</td>
940                                             [% END %]
941                                             <td><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% XISBN.biblionumber %]">[% XISBN.title |html %]</a>
942                                                 [% IF ( XISBN.author ) %] by [% XISBN.author |html %][% END %]
943                                                 [% IF ( XISBN.copyrightdate ) %] &copy;[% XISBN.copyrightdate %][% END %]
944                                                 [% IF ( XISBN.publishercode ) %]
945                                                     <p>[% XISBN.publishercode |html %]
946                                                         [% IF ( XISBN.place ) %]([% XISBN.place %])[% END %]
947                                                         [% IF ( XISBN.publicationyear ) %], [% XISBN.publicationyear %][% END %]
948                                                         [% IF ( XISBN.pages ) %][% XISBN.pages %] [% XISBN.illus %] [% XISBN.size %][% END %]
949                                                     </p>
950                                                 [% END %]
951                                             </td>
952                                         </tr>
953                                     [% END # / FOREACH XISBNS %]
954                                 </table>
955                             </div> <!-- / #editions -->
956                         [% END # / IF OPACFRBRizeEditions && XISBNS %]
957
958                         [% IF ( HTML5MediaEnabled ) %]
959                             <div id="html5media">
960                                     <p>
961                                         <[% HTML5MediaParent %] controls preload=none>
962                                           [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
963                                             <[% HTML5MediaSet.child  %] src="[% HTML5MediaSet.srcblock %]"[% HTML5MediaSet.typeblock %] />
964                                           [% END %]
965                                             [[% HTML5MediaParent %] tag not supported by your browser.]
966                                         </[% HTML5MediaParent %]>
967                                     </p>
968                             </div>
969                         [% END # / IF HTML5MediaEnabled %]
970
971                         [% IF ( OPACLocalCoverImages && localimages.size ) %]
972                             <div id="images">
973                                 <p>Click on an image to view it in the image viewer</p>
974                                 [% FOREACH image IN localimages %]
975                                     [% IF image %]
976                                         <a class="localimage" href="/cgi-bin/koha/opac-imageviewer.pl?biblionumber=[% biblionumber %]&amp;imagenumber=[% image %]"><img alt="" src="/cgi-bin/koha/opac-image.pl?thumbnail=1&amp;imagenumber=[% image %]" /></a>
977                                     [% END %]
978                                 [% END %]
979                             </div><!-- / #images -->
980                         [% END # / IF OPACLocalCoverImages && localimages.size %]
981
982                         [% IF ( IDreamBooksReviews ) %]
983                             <div id="idb_critic_reviews">
984                                 <div id="idb_review_snippets"></div>
985                                 <span><a id="seemoreidb">More book reviews at iDreamBooks.com</a></span>
986                             </div>
987                         [% END %]
988                 </div> <!-- / #bibliodescriptions -->
989
990                 [% IF ( NovelistSelectProfile && NovelistSelectView == 'below' ) %]
991                     <div id="NovelistSelect">
992                         <h3>Novelist Select</h3>
993                         <div data-novelist-novelistselect="[% normalized_isbn %]"></div>
994                     </div>
995                 [% END %]
996
997                 [% IF ( Babeltheque ) %]
998                     <div>
999                         <div id="BW_etiquettes"></div>
1000                         <div id="BW_suggestions"></div>
1001                     </div>
1002                     <div class="clearfix"></div>
1003                     <div>
1004                         <div id="BW_podcasts"></div>
1005                     </div>
1006                     <div class="clearfix"></div>
1007                     <div>
1008                         <div id="BW_videos"></div>
1009                     </div>
1010                 [% END # / IF Babeltheque %]
1011         </div> <!-- /.span8 -->
1012
1013         <div class="span3">
1014             <div id="ulactioncontainer">
1015
1016                 [% IF ( OpacBrowseResults && busc ) %]
1017                     <div class="nav_results">
1018                         <div class="l_Results">
1019                             [% IF ( listResults ) %]
1020                                 <a href="#" id="a_listResults" title="Show pagination list ([% indexPag %]-[% indexPagEnd %] / [% totalPag %])">Browse results</a>
1021                             [% ELSE %]
1022                                 <span>Browse results</span>
1023                             [% END %]
1024                         </div>
1025                         <ul class="pg_menu clearfix">
1026                             <li class="left_results">
1027                                 [% IF ( previousBiblionumber ) %]
1028                                     <a href="opac-detail.pl?biblionumber=[% previousBiblionumber %][% IF ( query_desc && OpacHighlightedWords ) %]&query_desc=[% query_desc |uri %][% END %]" title="See: [% IF ( previousTitle ) %][% previousTitle |html %][% ELSE %]previous biblio[% END %]">&laquo; Previous</a>
1029                                 [% ELSE %]
1030                                     <span>Previous</span>
1031                                 [% END %]
1032                             </li>
1033                             <li class="back_results"><a href="opac-search.pl?[% busc |url %]" title="Back to the results search list">Back to results</a></li>
1034                             <li class="right_results">
1035                                 [% IF ( nextBiblionumber ) %]
1036                                     <a href="opac-detail.pl?biblionumber=[% nextBiblionumber %][% IF ( query_desc && OpacHighlightedWords ) %]&query_desc=[% query_desc |uri %][% END %]" title="See: [% IF ( nextTitle ) %][% nextTitle |html %][% ELSE %]next biblio[% END %]">Next &raquo;</a>
1037                                 [% ELSE %]
1038                                     <span>Next</span>
1039                                 [% END %]
1040                             </li>
1041                         </ul>
1042                         [% IF ( listResults ) %]
1043                         <div class="results-pagination">
1044                             <div class="nav_pages">
1045                                 <span class="close_pagination"><a href="#" id="close_pagination">Close</a></span>
1046                                 <ul id="listResults"></ul>
1047                             </div>
1048                             <div class="pagination_list">
1049                                 <ul id="ul_pagination_list"></ul>
1050                             </div>
1051                         </div>
1052                         [% END %]
1053                     </div>
1054                 [% END # / IF OpacBrowseResults && busc %]
1055
1056                 [% INCLUDE 'opac-detail-sidebar.inc' %]
1057
1058                 [% IF ( NovelistSelectProfile && NovelistSelectView == 'right') %]
1059                     <div id="NovelistSelect">
1060                         <h4>Novelist Select</h4>
1061                         <div data-novelist-novelistselect=[% normalized_isbn %]></div>
1062                     </div>
1063                 [% END %]
1064
1065                 [% IF ( Babeltheque ) %]
1066                     <div class="babeltheque_adds">
1067                         <div id="BW_critiques_aj"></div>
1068                         <div id="BW_citations_aj"></div>
1069                     </div>
1070                 [% END %]
1071
1072                 [% IF ( SocialNetworks ) %]
1073                     <div id="social_networks" class="clearfix">
1074                         <span>Share</span>
1075                         <div><a id="facebook" href="http://www.facebook.com/sharer.php?u=[% current_url |url %]&amp;t=[% title |url %]" title="Share on Facebook">Facebook</a></div>
1076                         <div><a id="linkedin" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=[% current_url |url %]&amp;title=[% title |url %]" title="Share on LinkedIn">LinkedIn</a></div>
1077                         <div><a id="delicious" href="http://www.delicious.com/save?url=[% current_url |url %]&amp;title=[% title |url %]" title="Share on Delicious">Delicious</a></div>
1078                         <div><a id="email" href="mailto:?subject=[% title |url %]&amp;body=[% title |url %]%20([% current_url |url %])" title="Share by email">Email</a></div>
1079                         <div><div class="g-plusone" data-size="small" data-count="false"></div></div>
1080                         <div><a id="twitter" href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-text="[% title %]" data-lang="[% lang %]">Tweet</a></div>
1081                     </div>
1082                 [% END %]
1083             </div> <!-- / .ulactioncontainer -->
1084         </div> <!-- / .span4 -->
1085     </div> <!-- / .row-fluid -->
1086     <div class="row-fluid">
1087         [% IF ( LibraryThingForLibrariesID ) %]
1088             [% IF ( using_https ) %]
1089                 <script src="https://ltfl.librarything.com/forlibraries/widget.js?systype=koha&amp;id=[% LibraryThingForLibrariesID %]" type="text/javascript"></script>
1090                 <noscript>This page contains enriched content visible when JavaScript is enabled or by clicking
1091                 <a href="https://www.librarything.com/forlibraries/noscript.php?id=[% LibraryThingForLibrariesID %]&amp;accessibility=1">here</a>.</noscript>
1092             [% ELSE %]
1093                 <script src="http://ltfl.librarything.com/forlibraries/widget.js?systype=koha&amp;id=[% LibraryThingForLibrariesID %]" type="text/javascript"></script>
1094                 <noscript>This page contains enriched content visible when JavaScript is enabled or by clicking
1095                 <a href="http://www.librarything.com/forlibraries/noscript.php?id=
1096                 [% LibraryThingForLibrariesID %]&amp;accessibility=1">here</a>.</noscript>
1097             [% END %]
1098         [% END %]
1099
1100         [% IF ( NovelistSelectProfile ) %]
1101             <script type="text/javascript" src="http://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
1102         [% END %]
1103
1104         [% IF ( Babeltheque ) %]
1105             <script type="text/javascript" src="[% Babeltheque_url_js %]"></script>
1106         [% END %]
1107     </div> <!-- / .row-fluid -->
1108 </div> <!-- / .container-fluid -->
1109 </div> <!-- / .main -->
1110
1111 [% INCLUDE 'opac-bottom.inc' %]
1112
1113 [%# End of template %]
1114
1115 [% BLOCK items_table %]
1116     <table class="holdingst table table-bordered table-striped">
1117         <thead>
1118             <tr>
1119                 [% IF ( item_level_itypes ) %]<th id="item_itemtype" class="itype">Item type</th>[% END %]
1120                 <th id="item_location">Location</th>
1121                 [% IF ( itemdata_ccode ) %]<th id="item_ccode" class="collection">Collection</th>[% END %]
1122                 <th id="item_callnumber" class="call_no">Call number</th>
1123                 [% IF ( itemdata_enumchron ) %]<th id="item_enumchron" class="vol_info">Vol info</th>[% END %]
1124                 [% IF ( itemdata_uri ) %]<th id="item_url" class="url">url</th>[% END %]
1125                 [% IF ( itemdata_copynumber ) %]<th id="item_copy" class="copynumber">Copy number</th>[% END %]
1126                 <th id="item_status" class="status">Status</th>
1127                 [% IF ( itemdata_itemnotes ) %]<th id="item_notes" class="notes">Notes</th>[% END %]
1128                 <th id="item_datedue" class="date_due">Date due</th>
1129                 [% IF ( OPACShowBarcode ) %]<th id="item_barcode" class="barcode">Barcode</th>[% END %]
1130                 [% IF holds_count.defined %]
1131                     <th>Item holds</th>
1132                 [% ELSIF show_priority %]
1133                     <th>Item hold queue priority</th>
1134                 [% END %]
1135                 [% IF ( ShowCourseReservesHeader ) %]<th id="item_coursereserves">Course reserves</th>[% END %]
1136             </tr>
1137         </thead>
1138         <tbody>
1139             [% FOREACH ITEM_RESULT IN items %]
1140                 [% IF ITEM_RESULT.this_branch %]
1141                   <tr class="highlight-row-detail" vocab="http://schema.org/" typeof="Offer">
1142                 [% ELSE %]
1143                   <tr vocab="http://schema.org/" typeof="Offer">
1144                 [% END %]
1145                     [% IF ( item_level_itypes ) %]
1146                         <td class="itype">
1147                             [% UNLESS ( noItemTypeImages ) %]
1148                                 [% IF ( ITEM_RESULT.imageurl ) %]
1149                                     <img src="[% ITEM_RESULT.imageurl %]" title="[% ITEM_RESULT.description %]" alt="[% ITEM_RESULT.description %]" />
1150                                 [% END %]
1151                             [% END %]
1152                             [% ITEM_RESULT.description %]
1153                         </td>
1154                     [% END %]
1155                     <td class="location" property="seller">
1156                     <link property="itemOffered" href="#record" />
1157                     <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut">
1158                         [% UNLESS ( singleBranchMode ) %]
1159                             <div class="[% ITEM_RESULT.branch_opac_info ? 'branch-info-tooltip-trigger' : '' %]">
1160                             [% IF ( ITEM_RESULT.branchurl ) %]
1161                                 <a href="[% ITEM_RESULT.branchurl %]" title="">[% ITEM_RESULT.branchname %]</a>
1162                             [% ELSE %]
1163                                 <span title="">[% ITEM_RESULT.branchname %]</span>
1164                             [% END %]
1165                                 <div class="branch-info-tooltip">[% ITEM_RESULT.branch_opac_info %]</div>
1166                             </div>
1167                         [% END %]
1168                         <span class="shelvingloc">[% ITEM_RESULT.location_description %]</span>
1169                     </td>
1170                     [% IF ( itemdata_ccode ) %]
1171                         <td class="collection">[% ITEM_RESULT.ccode %]</td>
1172                     [% END %]
1173                     <td class="call_no" property="sku">
1174                         [% IF ( ITEM_RESULT.itemcallnumber ) %]
1175                             [% ITEM_RESULT.itemcallnumber %]
1176                             [% IF ( OPACShelfBrowser ) %]
1177                                 [% IF ( ITEM_RESULT.itemnumber == starting_itemnumber ) %]
1178                                     (<a class="close_shelf" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ITEM_RESULT.biblionumber %]&amp;shelfbrowse_itemnumber=[% ITEM_RESULT.itemnumber %]#[% tab %]">Browse shelf</a>)
1179                                 [% ELSE %]
1180                                     (<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ITEM_RESULT.biblionumber %]&amp;shelfbrowse_itemnumber=[% ITEM_RESULT.itemnumber %]#[% tab %]">Browse shelf</a>)
1181                                 [% END %]
1182                             [% END %]
1183                         [% END %]
1184                     </td>
1185                     [% IF ( itemdata_enumchron ) %]
1186                         <td class="vol_info">[% ITEM_RESULT.enumchron %]</td>
1187                     [% END %]
1188                     [% IF ( itemdata_uri ) %]
1189                         <td class="url">
1190                             [% IF ITEM_RESULT.uri %]
1191                                 [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
1192                                     <a href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | url %]&amp;biblionumber=[% biblionumber |url %]&amp;itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url"> Link to resource </a>
1193                                 [% ELSE %]
1194                                     <a href="[% ITEM_RESULT.uri %]" property="url">[% ITEM_RESULT.uri %]</a>
1195                                 [% END %]
1196                             [% END %]
1197                         </td>
1198                     [% END %]
1199                     [% IF ( itemdata_copynumber ) %]<td class="copynumber">[% ITEM_RESULT.copynumber %]</td>[% END %]
1200                     <td class="status">[% INCLUDE 'item-status-schema-org.inc' item = ITEM_RESULT %][% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td>
1201                     [% IF ( itemdata_itemnotes ) %]<td class="notes" property="description">[% ITEM_RESULT.itemnotes %]</td>[% END %]
1202                     <td class="date_due"><span title="[% ITEM_RESULT.datedue %]">[% ITEM_RESULT.datedue | $KohaDates %]</span></td>
1203                     [% IF ( OPACShowBarcode ) %]<td class="barcode" property="serialNumber">[% ITEM_RESULT.barcode %]</td>[% END %]
1204                     [% IF holds_count.defined || show_priority %]
1205                         <td class="holds_count">
1206                             [% IF holds_count.defined %] [% ITEM_RESULT.holds_count %] [% END %]
1207                             [% IF ITEM_RESULT.priority %]
1208                                 [% IF holds_count.defined %]
1209                                     (priority [% ITEM_RESULT.priority %])
1210                                 [% ELSE %]
1211                                     [% ITEM_RESULT.priority %]
1212                                 [% END %]
1213                             [% END %]
1214                         </td>
1215                     [% END %]
1216                     [% IF ShowCourseReservesHeader %]
1217                         <td>
1218                             [% IF ITEM_RESULT.course_reserves %]
1219                                 [% FOREACH r IN ITEM_RESULT.course_reserves %]
1220                                     <p>
1221                                         <a href="opac-course-details.pl?course_id=[% r.course.course_id %]">
1222                                         [% r.course.course_name %]
1223                                         <!--[% IF r.course.course_number %] [% r.course.course_number %] [% END %]-->
1224                                         [% IF r.course.section %] [% r.course.section %] [% END %]
1225                                         [% IF r.course.term %] [% AuthorisedValues.GetByCode( 'TERM', r.course.term ) %] [% END %]
1226                                         </a>
1227                                     </p>
1228                                 [% END %]
1229                             [% END %]
1230                         </td>
1231                     [% END  # /IF ShowCourseReservesHeader %]
1232                 </tr>
1233             [% END %]
1234         </tbody>
1235     </table>
1236 [% END %][%# end of items_table block %]
1237
1238 [% BLOCK jsinclude %]
1239 [% INCLUDE 'datatables.inc' %]
1240 [% IF ( SocialNetworks ) %]
1241     <script type="text/javascript" src="https://apis.google.com/js/plusone.js">
1242     //<![CDATA[
1243       {lang: '[% lang %]'}
1244     //]]>
1245     </script>
1246     <script type="text/javascript">!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
1247 [% END %]
1248 [% IF ( OpacStarRatings != 'disable' ) %]<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.rating.js"></script>[% END %]
1249
1250 [% IF ( OpacHighlightedWords ) %]<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.highlight-3.js"></script>[% END %]
1251
1252 <script type="text/javascript">
1253 //<![CDATA[
1254
1255     [% IF ( OpacBrowseResults && busc ) %]
1256         var arrPagination = new Array();
1257         var pag_index_ini = [% indexPag %];
1258         [% IF ( listResults ) %]
1259             [% FOREACH listResult IN listResults %]
1260                 arrPagination[[% listResult.index %]] = {
1261                     url:"[% listResult.url %][% IF ( listResult.url && query_desc && OpacHighlightedWords ) %]&query_desc=[% query_desc |uri %][% END %]",
1262                     title:"[% listResult.title|remove('\n')|html %]",
1263                     author:"[% listResult.author|html %]",
1264                     biblionumber:[% listResult.biblionumber %]
1265                 };
1266            [% END %]
1267         [% END %]
1268     [% END %]
1269
1270     [% IF ( OpacHighlightedWords ) %]
1271         var q_array = new Array();  // holds search terms if available
1272
1273         function highlightOff() {
1274             $("#catalogue_detail_biblio").removeHighlight();
1275             $(".highlight_toggle").toggle();
1276         }
1277         function highlightOn() {
1278             var x;
1279             for (x in q_array) {
1280                 q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
1281                 $(".title").highlight(q_array[x]);
1282                 $(".author").highlight(q_array[x]);
1283                 $(".results_summary").highlight(q_array[x]);
1284             }
1285             $(".highlight_toggle").toggle();
1286         }
1287     [% END %]
1288
1289      $(document).ready(function() {
1290         $('#bibliodescriptions').tabs();
1291         $(".branch-info-tooltip-trigger").tooltip({
1292             position: { my: "left+15 center", at: "right center" },
1293             show: 50,
1294             hide: 50,
1295             content: function(){
1296                 var element = $(this).next("div");
1297                 return element.html();
1298             }
1299         });
1300 [% IF ( TagsInputEnabled && loggedinusername ) %]
1301         $(".tag_add").click(function(){
1302             var thisid = $(this).attr("id");
1303             thisid = thisid.replace("tag_add","");
1304             $(this).hide();
1305             $("#tagform"+thisid).show();
1306             $("#newtag"+thisid).focus();
1307             $("#newtag"+thisid+"_status").empty().hide();
1308             return false;
1309         });
1310         $(".cancel_tag_add").click(function(){
1311             var thisid = $(this).attr("id");
1312             thisid = thisid.replace("cancel","");
1313             $("#tagform"+thisid).hide();
1314             $("#tag_add"+thisid).show();
1315             $("#newtag"+thisid).val("");
1316             $("#newtag"+thisid+"_status").empty().hide();
1317             return false;
1318         });
1319         $(".tagbutton").click(function(){
1320             var thisid = $(this).attr("title");
1321             var tag = $("#newtag"+thisid).val();
1322             if (!tag || (tag == "")) {
1323                 alert(MSG_NO_TAG_SPECIFIED);
1324                 return false;
1325             }
1326             KOHA.Tags.add_tag_button(thisid, tag);
1327             return false;
1328         });
1329 [% END %]
1330
1331         $(".holdingst").dataTable($.extend(true, {}, dataTablesDefaults, {
1332             "aoColumns": [
1333                 [% IF ( item_level_itypes ) %]null,[% END %]
1334                 null,
1335                 [% IF ( itemdata_ccode ) %]null,[% END %]
1336                 null,
1337                 [% IF ( itemdata_enumchron ) %]null,[% END %]
1338                 [% IF ( itemdata_uri ) %]null,[% END %]
1339                 [% IF ( itemdata_copynumber ) %]null,[% END %]
1340                 null,
1341                 [% IF ( itemdata_itemnotes ) %]null,[% END %]
1342                 { "sType": "title-string" },
1343                 [% IF ( OPACShowBarcode ) %]null,[% END %]
1344                 [% IF holds_count.defined %]
1345                     null,
1346                 [% ELSIF show_priority %]
1347                     null,
1348                 [% END %]
1349                 [% IF ( ShowCourseReservesHeader ) %]null,[% END %]
1350             ]
1351         }));
1352
1353         [% IF ( query_desc ) %][% IF ( OpacHighlightedWords ) %]var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') |html %]";
1354             q_array = query_desc.split(" ");
1355             highlightOn();
1356             $("#highlight_toggle_on" ).hide().click(function() {highlightOn() ; return false;});
1357             $("#highlight_toggle_off").show().click(function() {highlightOff(); return false;});[% END %][% END %]
1358     [% IF ( GoogleJackets ) %]
1359         KOHA.Google.GetCoverFromIsbn([% covernewwindow %]);
1360     [% END %]
1361     [% IF OpenLibraryCovers %]
1362         KOHA.OpenLibrary.GetCoverFromIsbn();
1363     [% END %]
1364     [% IF OPACLocalCoverImages %]
1365         KOHA.LocalCover.GetCoverFromBibnumber(true);
1366     [% END %]
1367     [% IF ( NovelistSelectProfile ) %]
1368         novSelect.loadContentForISBN('[% normalized_isbn %]','[% NovelistSelectProfile %]', '[% NovelistSelectPassword %]', function(d){});
1369     [% END %]
1370
1371     [% IF ( OpacBrowseResults && busc ) %]
1372         if (arrPagination.length > 0) {
1373             renderPagIndexList(pag_index_ini, $("#listResults"));
1374         }
1375         $("#a_listResults").click(function(e) {
1376             if (arrPagination.length > 0) {
1377                 e.preventDefault();
1378                 var navigation = $(".results-pagination");
1379                 if (navigation.css("display") == 'none') {
1380                     navigation.show();
1381                     var newtitle = $(this).attr('title').replace('Show', 'Hide')
1382                     $(this).attr('title',newtitle);
1383                     renderPagination(pag_index_ini, arrPagination.length - 1, $("#ul_pagination_list"), false);
1384                 } else {
1385                     navigation.hide();
1386                     var newtitle = $(this).attr('title').replace('Hide', 'Show')
1387                     $(this).attr('title',newtitle);
1388                 }
1389             }
1390         });
1391         $("#close_pagination").click(function(e) {
1392             e.preventDefault();
1393             var navigation = $(".results-pagination");
1394             navigation.hide();
1395         });
1396     [% END %]
1397 [% IF ( OPACShelfBrowser ) %]
1398
1399     (function prepareShelfBrowser(){
1400
1401         $(".main").on("click",".close_shelf",function(e){
1402             e.preventDefault();
1403             $("#shelfbrowser").toggle();
1404         });
1405         $(".main").on("click", "#browser_previous a", function(e){
1406             e.preventDefault();
1407             $.ajax({
1408                 url: "/cgi-bin/koha/svc/shelfbrowser.pl",
1409                 type: "POST",
1410                 data: {
1411                     "shelfbrowse_itemnumber": $("#browser_previous a").data( "prev-itemnumber" )
1412                 },
1413                 success: function(data){
1414                     $("#shelfbrowser").replaceWith(data);
1415                     [% IF ( GoogleJackets ) %]
1416                       KOHA.Google.GetCoverFromIsbn([% covernewwindow %]);
1417                     [% END %]
1418                     [% IF OpenLibraryCovers %]
1419                       KOHA.OpenLibrary.GetCoverFromIsbn();
1420                     [% END %]
1421                     [% IF OPACLocalCoverImages %]
1422                       KOHA.LocalCover.GetCoverFromBibnumber(true);
1423                     [% END %]
1424                 }
1425             });
1426         });
1427
1428         $(".main").on("click", "#browser_next a", function(e){
1429             e.preventDefault();
1430             $.ajax({
1431                   url: "/cgi-bin/koha/svc/shelfbrowser.pl",
1432                   type: "POST",
1433                   data: {
1434                     "shelfbrowse_itemnumber": $("#browser_next a").data( "next-itemnumber" )
1435                 },
1436                 success: function(data){
1437                     $("#shelfbrowser").replaceWith(data);
1438                     [% IF ( GoogleJackets ) %]
1439                       KOHA.Google.GetCoverFromIsbn([% covernewwindow %]);
1440                     [% END %]
1441                     [% IF OpenLibraryCovers %]
1442                       KOHA.OpenLibrary.GetCoverFromIsbn();
1443                     [% END %]
1444                     [% IF OPACLocalCoverImages %]
1445                       KOHA.LocalCover.GetCoverFromBibnumber(true);
1446                     [% END %]
1447                 }
1448             });
1449         });
1450     }());
1451 [% END %]
1452 [% IF ( OpacStarRatings != 'disable' ) %]
1453     // -----------------------------------------------------
1454     // star-ratings code
1455     // -----------------------------------------------------
1456     // hide 'rate' button if javascript enabled
1457
1458     $('input[name="rate_button"]').remove();
1459
1460     $(function () {
1461       $(".auto-submit-star").rating({
1462         callback: function (value, link) {
1463
1464           // if the new value equals the old value, dont execute callback...
1465           // just do nothing!
1466           if ($("#rating_value").attr("value") != value) {
1467
1468             $(function () {
1469
1470               $.post("/cgi-bin/koha/opac-ratings-ajax.pl", {
1471                 rating_old_value: $("#rating_value").attr("value"),
1472                 borrowernumber: "[% borrowernumber %]",
1473                 biblionumber: "[% biblionumber %]",
1474                 rating_value: value,
1475                 auth_error: value
1476               }, function (data) {
1477
1478                 if (data.auth_status != 'ok') {
1479                   window.alert(_("Your CGI session cookie is not current. Please refresh the page and try again."));
1480                 } else {
1481                   $("#rating_value").val(data.rating_value);
1482
1483                   if (data.rating_value) {
1484                     $("#rating_value_text").text(_("your rating: ") + data.rating_value + ", ");
1485                   } else {
1486                     $("#rating_value_text").text('');
1487                   }
1488
1489                   $("#rating_text").text(_("average rating: ") + data.rating_avg_int + " (" + data.rating_total + ' ' + _("votes") + ")");
1490
1491                 }
1492               }, "json");
1493             });
1494           };
1495         }
1496       });
1497     });
1498     // -----------------------------------------------------
1499 [% END # / IF ( OpacStarRatings != 'disable' )%]
1500
1501 [% IF ( IDreamBooksReviews || IDreamBooksReadometer ) %]
1502     var isbn = $(".isbn:last").text().split(" ")[1];
1503     if (isbn) {
1504         isbn = isbn.replace(/\W*$/, '');
1505         isbn = isbn.replace(/-/, '');
1506
1507         if ($.browser.msie && parseInt($.browser.version, 10) >= 8 && window.XDomainRequest) {
1508         // Use Microsoft XDR for IE version 8 or above
1509             var xdr = new XDomainRequest();
1510             xdr.open("get", "http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e");
1511             xdr.onload = function() {
1512                 json = 'json = '+xdr.responseText; // the string now looks like..  json = { ... };
1513                 eval(json); // json is now a regular JSON object
1514                 parseIDBJSON(json); // parse using same function as for jQuery's success event
1515             }
1516             xdr.send();
1517         } else {
1518             $.getJSON("http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){
1519                 parseIDBJSON(json);
1520             });
1521         }
1522     }
1523 [% END # / IDreamBooksReviews || IDreamBooksReadometer%]
1524
1525 });
1526     [% IF ( IDreamBooksReviews || IDreamBooksReadometer ) %]
1527         function parseIDBJSON( json ) {
1528             if(json.total_results > 0 && json.book.rating > 0){
1529                 var isbn = $(".isbn:last").text().split(" ")[1];
1530                 isbn = isbn.replace(/-/, '');
1531
1532                 [% IF ( IDreamBooksReadometer ) %]
1533                     $(".title").append('<a href="'+json.book.detail_link+'" id="idreambooksreadometer"><img src="http://idreambooks.com/remotereadometer/'+isbn+'.jpg" alt="'+json.book.title+' by '+json.book.author+'" title="Rating based on reviews of '+json.book.title+'"></a>');
1534                 [% END %]
1535
1536                 [% IF ( IDreamBooksReviews ) %]
1537                     //build new tab for critic reviews
1538                     $("#tab_idb_critic_reviews a").text($("#tab_idb_critic_reviews a").text().replace('XXX', json.book.review_count));
1539
1540                     //append happy-sad cloud review
1541
1542                     $("#catalogue_detail_biblio").append("<span class='idreambookssummary results_summary'><a href='"+json.book.detail_link+"'><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+"%</a> <a href='http://www.idreambooks.com/'>rating based on reviews at iDreamBooks.com</a></span>");
1543
1544                     //insert data into Book reviews tab
1545                     $.each(json.book.critic_reviews, function(){
1546                             $("#idb_review_snippets").append("<div class='review'><div><a href='"+this.review_link+"'>"+this.source+"</a></div><div>\"..."+this.snippet+"...\"</div><div>Review date: "+this.review_date+"</div><div><a class='reviewlink' href='"+json.book.detail_link+"'>Review result: "+this.pos_or_neg+" <img src='"+this.smiley_or_sad_small+"' alt='iDreamBooks.com rating' title='"+this.pos_or_neg+"' /></a></div></div>");
1547                             });
1548                     $("#seemoreidb").attr('href', json.book.detail_link);
1549                     $("#tab_idb_critic_reviews").show();
1550                 [% END %]
1551             }
1552         }
1553     [% END # / IF IDreamBooksReviews || IDreamBooksReadometer %]
1554
1555     [% IF ( OpacBrowseResults && busc ) %]
1556         var timeoutRFW;
1557         var totalPagItemList = 10;
1558
1559         function rewindList()
1560         {
1561             var ul = $("#listResults");
1562             var li_ini = ul.children(':first').next();
1563             var index_ini = pag_index_ini;
1564             if (li_ini) {
1565                 index_ini = parseInt(li_ini.attr("class").substring(7), 10);
1566             }
1567             var li_end = ul.children(':last').prev();
1568             var index_end = arrPagination.length - 1;
1569             if (li_end) {
1570                 index_end = parseInt(li_end.attr("class").substring(7), 10);
1571             }
1572             if (index_ini > pag_index_ini) {
1573                 renderPagIndexList(index_ini - 1, ul, false);
1574                 renderPagination(index_ini - 1, arrPagination.length - 1, $("#ul_pagination_list"), true);
1575             }
1576         }//rewindList
1577
1578         function forwardList()
1579         {
1580             var ul = $("#listResults");
1581             var li_ini = ul.children(':first').next();
1582             var index_ini = pag_index_ini;
1583             if (li_ini) {
1584                 index_ini = parseInt(li_ini.attr("class").substring(7), 10);
1585             }
1586             var li_end = ul.children(':last').prev();
1587             var index_end = arrPagination.length - 1;
1588             if (li_end) {
1589                 index_end = parseInt(li_end.attr("class").substring(7), 10);
1590             }
1591             if (index_end < arrPagination.length - 1) {
1592                 renderPagIndexList(index_ini + 1, ul, false);
1593                 renderPagination(index_ini + 1, arrPagination.length - 1, $("#ul_pagination_list"), true);
1594             }
1595         }//forwardList
1596
1597         function renderPagIndexList(index, ul)
1598         {
1599             var $kids = ul.children("li");
1600             if ($kids.length > 0) {
1601                 $kids.each(function() {
1602                     $(this).remove();
1603                 });
1604             }
1605             var li;
1606             var html = "";
1607             var ini = index - 1;
1608             var end = ini + totalPagItemList - 1;
1609             li = $("<li />");
1610             html = (index > pag_index_ini)?"<a href='#' id='rew_list_index' onclick='rewindList()' title='" + _("Click to rewind the list to") + " " + ini + " - " + end + "'>&laquo;</a>":"&laquo;";
1611             li.html(html);
1612             ul.append(li);
1613             var title = "";
1614             for (var i=index; i < arrPagination.length && i < index + totalPagItemList; i++) {
1615                 if (arrPagination[i] == undefined) continue;
1616                 var li = $("<li />");
1617                 if (arrPagination[i].url != "") {
1618                     title = _("See biblio") + " &quot;" + arrPagination[i].title + "&quot; ";
1619                     if (arrPagination[i].author != "") title += " " + _("by") + "&quot;" + arrPagination[i].author + "&quot;";
1620                     title += " " + _("with biblionumber") + " " + arrPagination[i].biblionumber;
1621                     html = "<a href='" + arrPagination[i].url + "' title='" + title + "' class='a_pag' id='a_pag_" + i + "'";
1622                     html += " onmouseover='renderPagination(" + i + ", " + (arrPagination.length - 1) + ", $(\"#ul_pagination_list\"), true)'";
1623                     html += ">" + i + "</a>";
1624                 } else html = i;
1625                 li.html(html);
1626                 li.attr("class", "li_pag_" + i);
1627                 ul.append(li);
1628             }
1629             li = $("<li />");
1630             ini = index + 1;
1631             end = (arrPagination.length > index + totalPagItemList)?index + totalPagItemList:arrPagination.length - 1;
1632             html = (end <= arrPagination.length - 1 && (end - index) >= totalPagItemList)?"<a href='#' id='fw_list_index' onclick='forwardList()' title='" + _("Click to forward the list to") + " " + ini + " - " + end + "'>&raquo;</a>":"&raquo;";
1633             li.html(html);
1634             ul.append(li);
1635         }//renderPagIndexList
1636
1637
1638         function renderPagination(index, total, ul, highlIndex)
1639         {
1640             for (var i = pag_index_ini; i <= total; i++) {
1641                 if (arrPagination[i] == undefined || arrPagination[i].url == "") continue;
1642                 $("#li_pag_" + i).remove();
1643             }
1644             var j = 0;
1645             for (var i = index; i <= total && j < totalPagItemList; i++) {
1646                 if (arrPagination[i] == undefined || arrPagination[i].url == "") continue;
1647                 var li = $("<li id='li_pag_" + i + "' " + ((j % 2 == 0)?"class='highlight'":"")  + " title='" + _("Go to detail") + "' />");
1648                 var html = "<span class='li_pag_index'>" + i + "</span><a href='" + arrPagination[i].url + "'>" + arrPagination[i].title + "</a>";
1649                 if (arrPagination[i].author) html += "<br /> by " + arrPagination[i].author;
1650                 li.html(html);
1651                 if (highlIndex && i == index) li.css("backgroundColor", "#DDDDDD");
1652                 ul.append(li);
1653                 j++;
1654             }
1655             for (i = pag_index_ini; i < index && j < totalPagItemList; i++) {
1656                 if (arrPagination[i] == undefined || arrPagination[i].url == "") continue;
1657                 $("#li_pag_" + i).remove();
1658                 var li = $("<li id='li_pag_" + i + "' " + ((j % 2 == 0)?"class='highlight'":"")  + " title='" + _("Go to detail") + "' />");
1659                 var html = "<span class='li_pag_index'>" + i + "</span><a href='" + arrPagination[i].url + "'>" + arrPagination[i].title + "</a>";
1660                 if (arrPagination[i].author) html += "<br /> " + _("by") + " " + arrPagination[i].author;
1661                 li.html(html);
1662                 ul.append(li);
1663                 j++;
1664             }
1665         }//renderPagination
1666     [% END # / IF ( OpacBrowseResults && busc ) %]
1667 //]]>
1668 </script>
1669
1670 [% IF OPACPopupAuthorsSearch %]
1671     <script type="text/javascript">
1672     //<![CDATA[
1673         function showAuthors(element){
1674             var authornumber = $(element).attr("data-count");
1675             // Hide subjects menu if displayed
1676             hideMenu(".subjectSearch");
1677
1678             // Check checkbox related to the clicked link
1679             $("#authorsList input[type='checkbox']").attr('checked', false);
1680             $("#author_"+authornumber).attr('checked', true);
1681
1682             makeAuthorRequest();
1683
1684             // Display menu
1685             var left = element.offsetLeft || 0;
1686             var top = element.offsetTop || 0;
1687             $('.authorSearch').css('display', 'block');
1688             $('.authorSearch').css('left', left);
1689             $('.authorSearch').css('top', top + 15);
1690         }
1691
1692         function hideMenu(elem) {
1693             $(elem).css('display', 'none');
1694         }
1695
1696         function checkAll(checkbox, elem) {
1697             var check = $(checkbox).attr('checked') ? true : false;
1698             $(elem).find("input[type='checkbox']").attr('checked', check);
1699             elem == "#authorsList" ? makeAuthorRequest() : makeSubjectRequest();
1700         }
1701
1702         function makeAuthorRequest(){
1703             var values = [];
1704
1705             $("#authorsList").find("input[type='checkbox']:checked").each(function () {
1706                 values.push($(this).val());
1707             });
1708
1709             if (values.length > 0) {
1710                 var request = "/cgi-bin/koha/opac-search.pl?q=" + values.join(' and ');
1711                 $("#validAuthorSearch").attr("href", request);
1712             } else {
1713                 $("#validAuthorSearch").removeAttr("href");
1714             }
1715
1716         }
1717
1718         //Subjects
1719         function showSubjects(element, subjectnumber, subfieldnumber){
1720
1721             // Check checkbox related to the clicked link
1722             $("#subjectsList input[type='checkbox']").attr('checked', false);
1723             $("#subject_"+subjectnumber+"_"+subfieldnumber).attr('checked', true);
1724
1725             makeSubjectRequest();
1726
1727         }
1728
1729         function makeSubjectRequest() {
1730             var values = [];
1731             $("#subjectsList > ul").each(function() {
1732                 var all_checked = true;
1733                 var local_values = [];
1734                 $(this).find('input[type="checkbox"]').each(function() {
1735                     if($(this).attr('checked')) {
1736                         local_values.push($(this).val());
1737                     } else {
1738                         all_checked = false;
1739                     }
1740                 });
1741                 var authid = $(this).attr('data-authid');
1742                 if(all_checked && authid) {
1743                     values.push('an:' + authid);
1744                 } else {
1745                     values = values.concat(local_values);
1746                 }
1747             });
1748             if(values.length > 0) {
1749                 var request = "/cgi-bin/koha/opac-search.pl?q=" + values.join(' and ');
1750                 $("#validSubjectSearch").attr('href', request);
1751             } else {
1752                 $("#validSubjectSearch").removeAttr("href");
1753             }
1754         }
1755         $(document).ready(function() {
1756             $("a.showauthors").click(function(){
1757                 e.preventDefault();
1758                 showAuthors(this);
1759             });
1760         });
1761
1762     //]]>
1763     </script>
1764 [% END # / IF OPACPopupAuthorsSearch  %]
1765 [% END %]