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