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