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