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