Bug 29897: Fix tab display
[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
498                         [% IF Koha.Preference( 'OPACAuthorIdentifiers' ) && author_identifiers.size %]
499                             <li id="tab_author_identifiers" class="nav-item" role="presentation"><a href="#author_identifiers" class="nav-link" id="tab_author_identifiers-tab" data-toggle="tab" role="tab" aria-control="tab_author_identifiers">Author identifiers</a></li>
500                         [% END %]
501
502                     </ul>
503
504                     <div class="tab-content">
505                         [% IF ( serialcollection ) %]
506                             <div id="serialcollection" class="tab-pane" role="tabpanel" aria-labelledby="tab_serialcollection-tab">
507                                 <table id="serialcollectiont" class="table table-bordered table-striped">
508                                     <caption class="sr-only">Serial collections</caption>
509                                     <thead>
510                                         <tr>
511                                             <th id="serial_library">Library</th>
512                                             <th id="serial_collection">Serial collection</th>
513                                             <th id="serial_itemcallnumber">Item call number</th>
514                                         </tr>
515                                     </thead>
516                                     <tbody>
517                                         [% FOREACH serialcollection IN serialcollections %]
518                                             <tr>
519                                                 <td>[% serialcollection.branch | html %]</td>
520                                                 <td>[% serialcollection.text | html %]</td>
521                                                 <td>[% serialcollection.itemcallnumber | html %]</td>
522                                             </tr>
523                                         [% END %]
524                                     </tbody>
525                                 </table>
526                             </div> <!-- /#serialcollection -->
527                         [% END # / IF serialcollection %]
528
529
530                         <div id="holdings" class="tab-pane" role="tabpanel" aria-labelledby="holdings-tab">
531                             [% IF too_many_items %]
532                                 <p>This record has many physical items ([% items_count | html %]). <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | uri %]&amp;viewallitems=1">View all the physical items.</a></p>
533                             [% ELSIF ( itemloop.size ) %]
534                                 [% INCLUDE items_table items=itemloop tab="holdings" table_id="holdingst" %]
535                                 [% IF specific_item %]
536                                     <p><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | uri %]">Show all items</a></p>
537                                 [% ELSE %]
538                                     [% IF Koha.Preference('OPACAcquisitionDetails') and acquisition_details.total_quantity > 0 %]
539                                         [% IF acquisition_details.total_quantity == 1 %]
540                                             <span>1 item is on order.</span>
541                                         [% ELSE %]
542                                             <span>[% acquisition_details.total_quantity | html %] items are on order.</span>
543                                         [% END %]
544                                     [% END %]
545                                     [% IF holds_count.defined || priority %]
546                                         <div id="bib_holds">
547                                             [% IF holds_count.defined %]
548                                                 <span>Total holds: [% holds_count | html %]</span>
549                                             [% END %]
550                                             [% IF priority %]
551                                                 [% IF holds_count.defined %]
552                                                     <span>(priority [% priority | html %])</span>
553                                                 [% ELSE %]
554                                                     <span>Overall queue priority: [% priority | html %]</span>
555                                                 [% END %]
556                                             [% END %]
557                                         </div>
558                                     [% END %]
559
560                                 [% END # /IF specific_item %]
561                             [% ELSE %]
562                                 [% IF ( ALTERNATEHOLDINGS ) %]
563                                     [% FOREACH ALTERNATEHOLDING IN ALTERNATEHOLDINGS %]
564                                         <div id="alternateholdings"><span class="holdings_label">Holdings:</span> [% ALTERNATEHOLDING.holding | html %]</div>
565                                     [% END %]
566                                 [% ELSE %]
567                                     [% IF Koha.Preference('OPACAcquisitionDetails') and acquisition_details.total_quantity > 0 %]
568                                         [% IF acquisition_details.total_quantity == 1 %]
569                                             <span>1 item is on order.</span>
570                                         [% ELSE %]
571                                             <span>[% acquisition_details.total_quantity | html %] items are on order.</span>
572                                         [% END %]
573                                     [% ELSE %]
574                                         <div id="noitems">No physical items for this record</div>
575                                     [% END %]
576                                 [% END %]
577                             [% END # IF itemloop.size %]
578                             [% PROCESS 'shelfbrowser.inc' %]
579                             [% INCLUDE shelfbrowser tab='holdings' %]
580                             <br style="clear:both;" />
581                         </div> <!-- / #holdings -->
582
583                         [% IF (SeparateHoldings) %]
584                             <div id="otherholdings" class="tab-pane" role="tabpanel" aria-labelledby="otherholdings-tab">
585                                 [% IF (otheritemloop.size) %]
586                                     [% INCLUDE items_table items=otheritemloop tab="otherholdings" table_id="otherholdingst" %]
587                                 [% ELSE %]
588                                     <span>No other items.</span>
589                                 [% END %]
590                                 [% INCLUDE shelfbrowser tab='otherholdings' %]
591                             </div>
592                         [% END # / SeparateHoldings %]
593
594                         [% IF ( MARCNOTES || ( SyndeticsEnabled && SyndeticsSummary && SYNDETICS_SUMMARY )) %]
595                             <div id="descriptions" class="tab-pane" role="tabpanel" aria-labelledby="tab_descriptions-tab">
596                                 <div class="content_set">
597
598                                     [% IF ( SyndeticsEnabled && SyndeticsSummary && SYNDETICS_SUMMARY ) %]
599                                         <h2>Enhanced descriptions from Syndetics:</h2>
600                                         <p>[% SYNDETICS_SUMMARY | $raw %]</p>
601                                     [% END %]
602
603                                     [% IF ( MARCNOTES ) %]
604                                         <div id="marcnotes">
605                                         [% FOREACH MARCNOTE IN MARCNOTES %]
606                                             <p>
607                                             [% IF MARCNOTE.marcnote.match('^https?://\S+$') %]
608                                                 <a href="[% MARCNOTE.marcnote | url %]">[% MARCNOTE.marcnote | html %]</a>
609                                             [% ELSE %]
610                                                 [% MARCNOTE.marcnote | html | html_line_break %]
611                                             [% END %]
612                                             </p>
613                                         [% END %]
614                                         </div>
615                                     [% END %]
616
617                                 </div> <!-- /.content_set -->
618                             </div> <!-- / #descriptions -->
619                         [% END # / IF MARCNOTES %]
620
621                         [% IF ComponentParts && ComponentParts.size %]
622                             <div id="components" class="tab-pane" role="tabpanel" aria-labelledby="tab_components-tab">
623                                 <div class="content_set">
624                                     <table>
625                                         [% FOR PART IN ComponentParts %]
626                                             <tr>
627                                                 <td>
628                                                     [% PART | $raw %]
629                                                 </td>
630                                             </tr>
631                                         [% END %]
632                                     </table>
633                                     [% IF ComponentParts.size == Koha.Preference('MaxComponentRecords')%]
634                                         <p>Only [% ComponentParts.size | html %] results are shown: <a href="/cgi-bin/koha/opac-search.pl?q=[% ComponentPartsQuery | uri %]"/>show all component parts</a></p>
635                                     [% END %]
636                                 </div>
637                             </div>
638                         [% END %]
639
640                         [% IF ( SyndeticsEnabled ) %]
641                             [% IF ( SyndeticsTOC && SYNDETICS_TOC ) %]
642                                 <div id="toc" class="tab-pane" role="tabpanel" aria-labelledby="tab_toc-tab">
643                                     <div class="content_set">
644                                         <h2>Table of contents provided by Syndetics</h2>
645                                             <ul>
646                                                 [% FOREACH SYNDETICS_TO IN SYNDETICS_TOC %]
647                                                     <li><strong>[% SYNDETICS_TO.l | html %] [% SYNDETICS_TO.t | html %]</strong>[% IF ( SYNDETICS_TO.p ) %] ([% SYNDETICS_TO.p | $raw %])[% END %]</li>
648                                                 [% END %]
649                                             </ul>
650                                     </div>
651                                 </div>
652                             [% END # / IF SyndeticsTOC && SYNDETICS_TOC %]
653
654                             [% IF ( SyndeticsExcerpt && SYNDETICS_EXCERPT ) %]
655                                 <div id="excerpt" class="tab-pane" role="tabpanel" aria-labelledby="tab_excerpt-tab">
656                                     <div class="content_set">
657                                         <h2>Excerpt provided by Syndetics</h2>
658                                         [% SYNDETICS_EXCERPT | $raw %]
659                                     </div>
660                                 </div>
661                             [% END # / IF SyndeticsExcerpt && SYNDETICS_EXCERPT %]
662
663                             [% IF ( SyndeticsReviews && SYNDETICS_REVIEWS ) %]
664                                 <div id="reviews" class="tab-pane" role="tabpanel" aria-labelledby="tab_reviews-tab">
665                                     <div class="content_set">
666                                         <h2>Reviews provided by Syndetics</h2>
667                                         [% FOREACH SYNDETICS_REVIEW IN SYNDETICS_REVIEWS %]
668                                             [% IF ( SYNDETICS_REVIEW.title ) %]
669                                                 <h3>[% SYNDETICS_REVIEW.title | html %]</h3>
670                                                     [% FOREACH review IN SYNDETICS_REVIEW.reviews %]
671
672                                                         [% IF ( review.content ) %]
673                                                             [% review.content | $raw %]
674                                                         [% END %]
675
676                                                     [% END %]
677                                             [% END %]
678                                         [% END %]
679                                     </div>
680                                 </div>
681                             [% END # / IF SyndeticsReviews && SYNDETICS_REVIEWS %]
682
683                             [% IF ( SyndeticsAuthorNotes && SYNDETICS_ANOTES ) %]
684                                 <div id="anotes" class="tab-pane" role="tabpanel" aria-labelledby="tab_anotes-tab">
685                                     <div class="content_set">
686                                         <h2>Author notes provided by Syndetics</h2>
687                                         [% FOREACH SYNDETICS_ANOTE IN SYNDETICS_ANOTES %]
688                                             [% IF ( SYNDETICS_ANOTE.content ) %]
689                                                 [% SYNDETICS_ANOTE.content | $raw %]
690                                             [% END %]
691                                         [% END %]
692                                     </div>
693                                 </div>
694                             [% END # / IF SyndeticsReviews && SYNDETICS_REVIEWS %]
695                         [% END # / IF SyndeticsEnabled %]
696
697                         [% IF ( NovelistSelectProfile && NovelistSelectView == 'tab' && (normalized_isbn || normalized_upc) ) %]
698                             <div id="NovelistSelect" class="tab-pane" role="tabpanel" aria-labelledby="tab_NovelistSelect-tab">
699                                     <div data-novelist-novelistselect=[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]></div>
700                             </div>
701                         [% END # / IF NovelistSelectProfile && NovelistSelectView == 'tab' %]
702
703                         [% IF ( subscriptionsnumber ) %]
704                             <div id="subscriptions" class="tab-pane" role="tabpanel" aria-labelledby="tab_subscriptions-tab">
705                                 <h2>This is a serial</h2>
706                                 <p class="subscription_count">There are [% subscriptionsnumber | html %] subscription(s) associated with this title.</p>
707                                 [% FOREACH subscription IN subscriptions %]
708                                     <div class="subscription">
709                                         [% IF ( subscription.branchcode ) %]
710                                             <h3>At library: [% Branches.GetName( subscription.branchcode ) | html %]</h3>
711                                         [% ELSE %]
712                                             [% IF ( subscription.branchcode ) %]
713                                                 <h3>At library: [% subscription.branchcode | html %]</h3>
714                                             [% END %]
715                                         [% END %]
716                                         [% IF ( subscription.closed ) %]
717                                             <p class="subscription_closed">This subscription is closed.</p>
718                                         [% END %]
719                                         [% IF ( subscription.location ) %]
720                                             <p class="subscription_location">Location: [% AuthorisedValues.GetByCode( 'LOC', subscription.location, 1 ) | html %]
721                                         [% END %]
722                                         [% IF ( subscription.callnumber ) %]
723                                             <p class="subscription_callnumber">Call number: [% subscription.callnumber | html %]</p>
724                                         [% END %]
725                                         [% IF ( subscription.subscriptionnotes ) %]
726                                             <p class="subscription_notes">[% subscription.subscriptionnotes | html | html_line_break %] </p>
727                                         [% END %]
728                                         <p class="subscription_dates">Subscription from: [% subscription.histstartdate | $KohaDates %] to:[% IF ( subscription.histenddate ) %] [% subscription.histenddate | $KohaDates %] [% ELSE %] now (current)[% END %]</p>
729                                         [% IF ( subscription.letter ) %]
730                                             <span class="email_notifications">
731                                                 [% IF ( loggedinusername ) %]
732                                                     [% IF ( subscription.hasalert ) %]
733                                                         <span>You have subscribed to email notification on new issues. </span><a class="btn btn-secondary" title="Cancel email notification" href="/cgi-bin/koha/opac-alert-subscribe.pl?op=cancel&amp;subscriptionid=[% subscription.subscriptionid | html %]&amp;biblionumber=[% subscription.biblionumber | html %]">Cancel email notification</a>
734                                                     [% ELSE %]
735                                                         <a class="btn btn-secondary" title="Subscribe to email notification on new issues" href="/cgi-bin/koha/opac-alert-subscribe.pl?subscriptionid=[% subscription.subscriptionid | html %]&amp;biblionumber=[% subscription.biblionumber | html %]">Subscribe to email notification on new issues</a>
736                                                     [% END %]
737                                                 [% ELSE %]
738                                                     <span>You must log in if you want to subscribe to email notification on new issues</span>
739                                                 [% END %]
740                                             </span>
741                                         [% END %]
742                                         [% IF ( subscription.missinglist ) %]
743                                             <p class="subscription_missing">Missing issues: [% subscription.missinglist | html | html_line_break %] </p>
744                                         [% END %]
745                                         [% IF ( subscription.opacnote ) %]
746                                             <p class="subscription_opacnote">[% subscription.opacnote | html | html_line_break %]</p>
747                                         [% END %]
748                                         [% IF ( subscription.latestserials ) %]
749                                             <p class="subscription_latestissues"> The [% subscription.opacdisplaycount | html %] latest issues for this subscription:</p>
750                                             <table class="table table-bordered table-striped" id="subscriptionst">
751                                                 <caption class="sr-only">Latest serials</caption>
752                                                 <thead>
753                                                     <tr>
754                                                         <th id="serial_serialseq" data-colname="serial_serialseq">Issue #</th>
755                                                         <th id="serial_publisheddate" data-colname="serial_publisheddate">Publication date</th>
756                                                         <th id="serial_planneddate" data-colname="serial_planneddate">Received date</th>
757                                                         <th id="serial_status" data-colname="serial_status">Status</th>
758                                                         <th id="serial_notes" data-colname="serial_notes">Note</th>
759                                                     </tr>
760                                                 </thead>
761                                                 <tbody>
762                                                     [% FOREACH latestserial IN subscription.latestserials %]
763                                                         <tr>
764                                                             <td class="serialseq">[% latestserial.serialseq | html %]</td>
765                                                             <td class="publisheddate" data-order="[% latestserial.publisheddate | html %]">[% latestserial.publisheddate | $KohaDates %]</td>
766                                                             <td class="planneddate" data-order="[% latestserial.planneddate | html %]">[% latestserial.planneddate | $KohaDates %]</td>
767                                                             <td class="serial_status">
768                                                                 [% IF (latestserial.status1 ) %]<span>Expected</span>[% END %]
769                                                                 [% IF (latestserial.status2 ) %]<span>Arrived</span>[% END %]
770                                                                 [% IF (latestserial.status3 ) %]<span>Late</span>[% END %]
771                                                                 [% IF (latestserial.status4 ) %]<span>Missing</span>[% END %]
772                                                                     [% IF (latestserial.status41 ) %]<span>Missing (never received)</span>[% END %]
773                                                                     [% IF (latestserial.status42 ) %]<span>Missing (sold out)</span>[% END %]
774                                                                     [% IF (latestserial.status43 ) %]<span>Missing (damaged)</span>[% END %]
775                                                                     [% IF (latestserial.status44 ) %]<span>Missing (lost)</span>[% END %]
776                                                                 [% IF (latestserial.status5 ) %]<span>Not issued</span>[% END %]
777                                                                 [% IF (latestserial.status6 ) %]<span>Delete</span>[% END %]
778                                                                 [% IF (latestserial.status7 ) %]<span>Claimed</span>[% END %]
779                                                                 [% IF (latestserial.status8 ) %]<span>Stopped</span>[% END %]
780                                                             </td>
781                                                             <td class="serial_notes">[% latestserial.notes | html %]</td>
782                                                         </tr>
783                                                     [% END # / FOREACH latestserials %]
784                                                 </tbody>
785                                             </table>
786                                         [% END # / IF subscription.latestserials %]
787                                     </div>
788                                 [% END # / FOREACH subscriptions %]
789                                 <p class="subscription_moredetails"><a href="opac-serial-issues.pl?biblionumber=[% biblio.biblionumber | uri %]">More details</a></p>
790                             </div> <!-- / #subscriptions -->
791                         [% END # IF subscriptionsnumber %]
792
793                         [% IF ( LibraryThingForLibrariesID && LibraryThingForLibrariesTabbedView ) %]
794                             <!-- Library Thing for Libraries Content -->
795                             <div id="LFTLSimilarItems" class="tab-pane" role="tabpanel" aria-labelledby="tab_LFTLSimilarItems-tab">
796                                 <div class="content_set">
797                                     <!-- Uncommenting this span makes the font smaller in the tab for LTFL -->
798                                     <!-- but breaks Xhtml validation -->
799                                     <!--    <span class="results_summary">-->
800                                     <div id="ltfl_related"></div>
801                                     <div id="ltfl_similars"></div>
802                                     <!--            </span>-->
803                                 </div>
804                             </div>
805                             <div id="LTFLTagBrowse" class="tab-pane" role="tabpanel" aria-labelledby="tab_LTFLTagBrowse-tab">
806                                 <div class="content_set">
807                                     <!-- <span class="results_summary"> -->
808                                     <div id="ltfl_tagbrowse" class="ltfl"></div>
809                                     <!-- </span> -->
810                                 </div>
811                             </div>
812                         [% END # / IF LibraryThingForLibrariesID && LibraryThingForLibrariesTabbedView %]
813
814                         [% IF Koha.Preference( 'OPACComments' ) == 1 %]
815                             <div id="comments" class="tab-pane" role="tabpanel" aria-labelledby="tab_comments-tab">
816                                 <div id="newcomment"></div>
817                                     [% IF ( reviews ) %]
818                                         [% FOREACH review IN reviews %]
819                                             [% IF borrowernumber && review.borrowernumber == borrowernumber %]
820                                                 <div class="commentline yours" id="c[% review.reviewid | html %]">
821                                                     [% IF ( review.avatarurl ) %]
822                                                         <img class="avatar" src="[% review.avatarurl | html %]" height="80" width="80" alt="" />
823                                                     [% END %]
824                                                     [% IF review.approved %]
825                                                         <h2 id="comment">Your comment</h2>
826                                                     [% ELSE %]
827                                                         <h2 id="comment">Your comment (preview, pending approval)</h2>
828                                                     [% END %]
829                                                     <small>[% review.datereviewed | $KohaDates %]</small>
830                                                     <p>
831                                                         [% FILTER html_break %]
832                                                             [% review.review | html %]
833                                                         [% END %]
834                                                         <a href="#" onclick="Dopop('/cgi-bin/koha/opac-review.pl?biblionumber=[% review.biblionumber | uri %]&amp;reviewid=[% review.reviewid | uri %]');">Edit</a>
835                                                     </p>
836                                                 </div>
837                                             [% ELSE %]
838                                                 <div class="commentline">
839                                                     [% IF ( ShowReviewer != "none" && review.patron) %]
840
841                                                         [% IF ( review.avatarurl ) %]
842                                                             <img class="avatar" src="[% review.avatarurl | html %]" height="80" width="80" alt="" />
843                                                         [% END %]
844                                                         [% SWITCH ShowReviewer %]
845                                                         [% CASE 'full' %]
846                                                             <h2 id="comment">Comment by [% review.patron.title | html %] [% review.patron.firstname | html %] [% review.patron.surname | html %]</h2>
847                                                         [% CASE 'first' %]
848                                                             <h2 id="comment">Comment by [% review.patron.firstname | html %]</h2>
849                                                         [% CASE 'surname' %]
850                                                             <h2 id="comment">Comment by [% review.patron.surname | html %]</h2>
851                                                         [% CASE 'firstandinitial' %]
852                                                             <h2 id="comment">Comment by [% review.patron.firstname | html %] [% review.patron.surname|truncate(2,'.') | html %]</h2>
853                                                         [% CASE 'username' %]
854                                                             <h2 id="comment">Comment by [% review.patron.userid | html %]</h2>
855                                                         [% END %]
856
857                                                         <small>[% review.datereviewed | $KohaDates %]</small>
858                                                     [% ELSE %]
859                                                         <h2 id="comment">Patron comment on [% review.datereviewed | $KohaDates %]</h2>
860                                                     [% END # / IF ShowReviewer != "none" && review.patron %]
861                                                     <p>
862                                                         [% FILTER html_break %]
863                                                         [% review.review | html %]
864                                                         [% END %]
865                                                     </p>
866                                                 </div> <!-- / .commentline -->
867                                             [% END %]
868                                         [% END # / FOREACH reviews %]
869                                     [% ELSE %]
870                                         <p>There are no comments on this title.</p>
871                                     [% END # / IF reviews %]
872
873                                     [% IF ( loggedinusername ) %]
874                                         [% UNLESS ( loggedincommenter ) %]
875                                             <div id="addcomment">
876                                                 <a href="#" onclick="Dopop('/cgi-bin/koha/opac-review.pl?biblionumber=[% biblio.biblionumber | uri %]'); return false;">
877                                                 Post your comments on this title.
878                                                 </a>
879                                             </div>
880                                         [% END %]
881                                     [% ELSE %]
882                                         <div id="addcomment">
883                                             <a class="login-link loginModal-trigger" role="button" data-toggle="modal" href="/cgi-bin/koha/opac-user.pl">Log in to your account</a> to post a comment.
884                                         </div>
885                                     [% END # / IF loggedinusername %]
886                                 </div> <!-- / #comments -->
887                             [% END # / IF OPACComments %]
888
889                             [% IF ( OPACFRBRizeEditions && XISBNS ) %]
890                                 <div id="editions" class="tab-pane" role="tabpanel" aria-labelledby="tab_editions-tab">
891                                     <h2>Other editions of this work</h2>
892                                     <table class="table table-bordered table-striped">
893                                         <caption class="sr-only">Other editions</caption>
894                                         [% FOREACH XISBN IN XISBNS %]
895                                             <tr>
896                                                 <td>
897                                                     [% IF ( OPACAmazonCoverImages ) %]
898                                                         <img src="https://images-na.ssl-images-amazon.com/images/P/[% XISBN.normalized_isbn | html %].01._AA75_PU_PU-5_.jpg" alt="" />
899                                                     [% END %]
900
901                                                     [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
902                                                         [% IF ( XISBN.content_identifier_exists ) %]
903                                                             <img src="https://secure.syndetics.com/index.aspx?isbn=[% XISBN.browser_normalized_isbn | 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="" />
904                                                         [% ELSE %]
905                                                             <span class="no-image">No cover image available</span>
906                                                         [% END # / IF  XISBN.content_identifier_exists %]
907                                                     [% END # / IF SyndeticsEnabled && SyndeticsCoverImages %]
908                                                 </td>
909
910                                                 [% UNLESS ( item_level_itypes ) %]
911                                                     <td>[% XISBN.description | html %]</td>
912                                                 [% END %]
913                                                 <td>
914                                                     <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% XISBN.biblionumber | uri %]">[% XISBN.title | html %]</a>
915                                                     [% IF ( XISBN.author ) %]<span> by </span>[% XISBN.author | html %][% END %]
916                                                     [% IF ( XISBN.copyrightdate ) %]<span> &copy;</span>[% XISBN.copyrightdate | html %][% END %]
917                                                     [% IF ( XISBN.publishercode ) %]
918                                                         <p>[% XISBN.publishercode | html %]
919                                                             [% IF ( XISBN.place ) %]([% XISBN.place | html %])[% END %]
920                                                             [% IF ( XISBN.publicationyear ) %][% ', ' _ XISBN.publicationyear | html %][% END %]
921                                                             [% IF ( XISBN.pages ) %][% XISBN.pages | html %] [% XISBN.illus | html %] [% XISBN.size | html %][% END %]
922                                                         </p>
923                                                     [% END %]
924                                                 </td>
925                                             </tr>
926                                         [% END # / FOREACH XISBNS %]
927                                     </table>
928                                 </div> <!-- / #editions -->
929                             [% END # / IF OPACFRBRizeEditions && XISBNS %]
930
931                             [% IF ( HTML5MediaEnabled ) %]
932                                 <div id="html5media" class="tab-pane" role="tabpanel" aria-labelledby="tab_html5media-tab">
933                                 [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
934                                     <p>
935                                         [% IF HTML5MediaSet.is_youtube %]
936                                             <iframe id="player" type="text/html" width="640" height="360"
937                                                 src="[% HTML5MediaSet.srcblock | url %]" frameborder="0"></iframe>
938                                         [% ELSE %]
939                                             [% SET ctrl_preload = ' controls preload=none' #translatability %]
940                                             <[% HTML5MediaParent _ ctrl_preload | html %] >
941                                             <[% HTML5MediaSet.child | html %] src="[% HTML5MediaSet.srcblock | url %]" [% HTML5MediaSet.typeblock | html %] />
942                                             <span>[[% HTML5MediaParent | html %] tag not supported by your browser.]</span>
943                                             </[% HTML5MediaParent | html %]>
944                                         [% END %]
945                                     </p>
946                                 [% END %]
947                                 </div>
948                             [% END # / IF HTML5MediaEnabled %]
949
950                             [% IF ( OPACLocalCoverImages && localimages.count ) %]
951                                 <div id="images" class="tab-pane" role="tabpanel" aria-labelledby="tab_images-tab">
952                                     <p>Click on an image to view it in the image viewer</p>
953                                     [% FOREACH image IN localimages %]
954                                         <a href="/cgi-bin/koha/opac-imageviewer.pl?biblionumber=[% biblio.biblionumber | uri %]&amp;imagenumber=[% image.imagenumber | uri %]" title="Local cover image">
955                                             <img src="/cgi-bin/koha/opac-image.pl?thumbnail=1&amp;imagenumber=[% image.imagenumber | uri %]" alt="Local cover image" />
956                                         </a>
957                                     [% END %]
958                                 </div><!-- / #images -->
959                             [% END # / IF OPACLocalCoverImages && localimages.size %]
960
961                             [% IF Koha.Preference( 'OPACAuthorIdentifiers' ) && author_identifiers.size %]
962                                 <div id="author_identifiers" class="tab-pane" role="tabpanel" aria-labelledby="tab_author_identifiers-tab">
963                                     [% FOR author IN author_identifiers %]
964                                         <div class="author_identifier">
965                                             <span class="author_name"><a href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% author.authid | uri %]">[% author.name | html %]</a></span>
966                                             <ul>
967                                             [% FOR identifier IN author.identifiers %]
968                                                 <li>
969                                                     [% PROCESS "authority-identifiers.inc" identifier => identifier %]
970                                                 </li>
971                                             [% END %]
972                                             </ul>
973                                         </div>
974                                     [% END %]
975                                 </div>
976                             [% END %]
977
978                     </div> <!-- / #bibliodescriptions -->
979
980                     [% IF ( NovelistSelectProfile && NovelistSelectView == 'below' && ( normalized_isbn || normalized_upc ) ) %]
981                         <div id="NovelistSelect" class="tab-pane" role="tabpanel" aria-labelledby="tab_NovelistSelect-tab">
982                             <h2>Novelist Select</h2>
983                             <div data-novelist-novelistselect="[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]"></div>
984                         </div>
985                     [% END %]
986
987                     [% IF ( Babeltheque ) %]
988                         <div>
989                             <div id="BW_etiquettes"></div>
990                             <div id="BW_suggestions"></div>
991                         </div>
992                         <div class="clearfix"></div>
993                         <div>
994                             <div id="BW_podcasts"></div>
995                         </div>
996                         <div class="clearfix"></div>
997                         <div>
998                             <div id="BW_videos"></div>
999                         </div>
1000                     [% END # / IF Babeltheque %]
1001                 </div> <!-- /.tab-content -->
1002
1003             </div> <!-- /.col-lg-10 -->
1004
1005             <div class="col-lg-3">
1006                 <div id="ulactioncontainer">
1007
1008                     [% IF ( Koha.Preference('OpacBrowseResults') && busc ) %]
1009                         <div class="nav_results">
1010                             <div class="l_Results" style="display:none;">
1011                                 [% IF ( listResults ) %]
1012                                     <a href="#" id="a_listResults"><i class="fa fa-bars" aria-hidden="true"></i> Browse results</a>
1013                                 [% ELSE %]
1014                                     <span><i class="fa fa-bars" aria-hidden="true"></i> Browse results</span>
1015                                 [% END %]
1016                                 <a href="#" class="close_pagination"><i class="fa fa-remove" aria-hidden="true"></i> Close</a>
1017                             </div>
1018
1019                             <div class="pg_menu">
1020                                 <div class="pg_link left_results">
1021                                     [% IF ( previousBiblionumber ) %]
1022                                         <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>
1023                                     [% ELSE %]
1024                                         <span>Previous</span>
1025                                     [% END %]
1026                                 </div>
1027                                 [%# busc is already URI encoded %]
1028                                 <div class="pg_link back_results">
1029                                     <a href="opac-search.pl?[% busc | $raw %]" title="Back to the results search list">Back to results</a>
1030                                 </div>
1031                                 <div class="pg_link right_results">
1032                                     [% IF ( nextBiblionumber ) %]
1033                                         <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>
1034                                     [% ELSE %]
1035                                         <span>Next</span>
1036                                     [% END %]
1037                                 </div>
1038                             </div> <!-- /.pg_menu -->
1039
1040                             [% IF ( listResults ) %]
1041                                 <div class="results-pagination">
1042                                     <div class="nav_pages">
1043                                         <ul id="listResults">
1044                                             [% FOREACH listitem IN listResults %]
1045                                                 [% IF ( listitem.biblionumber == biblionumber ) %]
1046                                                     <li class="li_pag_[% loop.count | html %] highlight">
1047                                                 [% ELSE %]
1048                                                     <li class="li_pag_[% loop.count | html %]">
1049                                                 [% END %]
1050                                                     <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>
1051                                                 </li>
1052                                             [% END # /FOREACH listitem %]
1053                                         </ul> <!-- /#listResults -->
1054                                     </div> <!-- /.nav_pages -->
1055                                     <div class="pagination_list">
1056                                         <ul id="ul_pagination_lists">
1057                                             [% FOREACH listitem IN listResults %]
1058                                                 [% IF ( listitem.biblionumber == biblionumber ) %]
1059                                                     <li id="li_pag_[% loop.count | html %]" class="highlight" title="Go to detail">
1060                                                         <span class="li_pag_index"><i class="fa fa-arrow-left" aria-hidden="true"></i> [% loop.count  + offset | html %]</span>
1061                                                         <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 %]
1062                                                     </li>
1063                                                 [% ELSE %]
1064                                                     <li id="li_pag_[% loop.count | html %]" title="Go to detail">
1065                                                         <span class="li_pag_index">[% loop.count + offset | html %]</span>
1066                                                         <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 %]
1067                                                     </li>
1068                                                 [% END # /IF listitem.biblionumber %]
1069                                             [% END # /FOREACH listitem %]
1070                                         </ul> <!-- /#ul_pagination_list -->
1071                                     </div> <!-- /.pagination_list -->
1072                                 </div> <!-- /.results-pagination -->
1073                             [% END # /IF ( listResults ) %]
1074                             <div class="pagination_footer">
1075                                 <a href="#" class="close_pagination"><i class="fa fa-remove" aria-hidden="true"></i> Close</a>
1076                             </div>
1077                         </div> <!-- /.nav_results -->
1078                     [% END # / IF OpacBrowseResults && busc %]
1079
1080                     [% INCLUDE 'opac-detail-sidebar.inc' %]
1081
1082                     [% IF ( NovelistSelectProfile && NovelistSelectView == 'right' && ( normalized_isbn || normalized_upc ) ) %]
1083                         <div id="NovelistSelect">
1084                             <h2>Novelist Select</h2>
1085                             <div data-novelist-novelistselect="[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]"></div>
1086                         </div>
1087                     [% END %]
1088
1089                     [% IF ( Babeltheque ) %]
1090                         <div class="babeltheque_adds">
1091                             <div id="BW_critiques_aj"></div>
1092                             <div id="BW_citations_aj"></div>
1093                         </div>
1094                     [% END %]
1095
1096                     [% IF ( Koha.Preference('SocialNetworks') ) %]
1097                         <div id="social_networks" class="clearfix">
1098                             <span>Share</span>
1099                             [% SET SocialNetworks = Koha.Preference('SocialNetworks') %]
1100                             [% FOREACH network IN SocialNetworks.split(",") %]
1101                                 [% SWITCH network -%]
1102                                     [% CASE "facebook" -%]
1103                                         <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>
1104                                     [% CASE "linkedin" -%]
1105                                         <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>
1106                                     [% CASE "email" -%]
1107                                         <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>
1108                                     [% CASE "twitter" -%]
1109                                         <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>
1110                                 [% END # /SWITCH network -%]
1111                             [% END # /FOREACH network %]
1112                         </div> <!-- /#social_networks -->
1113                     [% END # /IF SocialNetworks %]
1114                 </div> <!-- / .ulactioncontainer -->
1115             </div> <!-- / .col-lg-3 -->
1116         </div> <!-- / .row -->
1117         <div class="row">
1118             [% IF ( LibraryThingForLibrariesID ) %]
1119                 <script src="https://ltfl.librarything.com/forlibraries/widget.js?systype=koha&amp;id=[% LibraryThingForLibrariesID | html %]"></script>
1120                 <noscript>This page contains enriched content visible when JavaScript is enabled or by clicking
1121                 <a href="https://www.librarything.com/forlibraries/noscript.php?id=[% LibraryThingForLibrariesID | uri %]&amp;accessibility=1">here</a>.</noscript>
1122             [% END %]
1123
1124             [% IF ( NovelistSelectProfile && ( normalized_isbn || normalized_upc ) ) %]
1125                 <script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
1126             [% END %]
1127
1128             [% IF ( Babeltheque && Babeltheque_url_js ) %]
1129                 <script src="[% Babeltheque_url_js | html %]"></script>
1130             [% END %]
1131         </div> <!-- / .row -->
1132     </div> <!-- / .container-fluid -->
1133 </div> <!-- / .main -->
1134
1135 [% IF ( OPACPopupAuthorsSearch  ) %]
1136     <!-- Modal -->
1137     <div class="modal" id="multiSearch" tabindex="-1" role="dialog" aria-labelledby="multiSearchLabel">
1138         <div class="modal-dialog" role="document">
1139             <div class="modal-content">
1140                 <div class="modal-header">
1141                     <h1 id="multiSearchLabel">Select the item(s) to search</h1>
1142                     <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
1143                 </div>
1144                 <div class="modal-body">
1145                     <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>
1146                     <a href="#" class="check_none btn btn-link btn-sm"><i class="fa fa-remove" aria-hidden="true"></i> Select none</a>
1147                     <ul id="termsList">
1148                     </ul>
1149                 </div>
1150                 <div class="modal-footer">
1151                     <button id="validMultiSearch" class="btn btn-primary">Search</button>
1152                     <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
1153                 </div>
1154             </div> <!-- /.modal-content -->
1155         </div> <!-- /.modal-dialog -->
1156     </div> <!-- /#myModal -->
1157 [% END %]
1158
1159 [% INCLUDE 'opac-bottom.inc' %]
1160
1161 [%# End of template %]
1162
1163 [% BLOCK items_table %]
1164     <table class="table table-bordered table-striped" id="[% table_id | html %]">
1165         <caption class="sr-only">Holdings</caption>
1166         <thead>
1167             <tr>
1168
1169                 [% IF Koha.Preference('OPACLocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %]
1170                     <th id="item_cover" data-colname="item_cover">Cover image</th>
1171                 [% END %]
1172                 [% IF ( item_level_itypes ) %]
1173                     <th id="item_itemtype" data-colname="item_itemtype" class="itype">Item type</th>
1174                 [% END %]
1175                 [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %]
1176                     <th id="item_current_location" data-colname="item_current_location" class="item_location">Current library</th>
1177                 [% END %]
1178                 [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %]
1179                     <th id="item_home_location" data-colname="item_home_location" class="item_location">Home library</th>
1180                 [% END %]
1181                 [% IF ( itemdata_ccode ) %]
1182                     <th id="item_ccode" data-colname="item_ccode" class="collection">Collection</th>
1183                 [% END %]
1184                 [% IF ( Koha.Preference('OpacLocationOnDetail') == 'column' && itemdata_location ) %]
1185                     <th id="item_shelving_location" data-colname="item_shelving_location" class="shelving_location">Shelving location</th>
1186                 [% END %]
1187                     <th id="item_callnumber" data-colname="item_callnumber" class="call_no">Call number</th>
1188                 [% UNLESS TablesSettings.is_hidden( 'opac', 'biblio-detail', 'holdingst', 'item_materials') %]
1189                     <th id="item_materials" data-colname="item_materials" class="materials">Materials specified</th>
1190                 [% END %]
1191                 [% IF ( itemdata_enumchron ) %]
1192                     <th id="item_enumchron" data-colname="item_enumchron" class="vol_info">Vol info</th>
1193                 [% END %]
1194                 [% IF ( itemdata_uri ) %]
1195                     <th id="item_url" data-colname="item_url" class="url">URL</th>
1196                 [% END %]
1197                 [% IF ( itemdata_copynumber ) %]
1198                     <th id="item_copy" data-colname="item_copy" class="copynumber">Copy number</th>
1199                 [% END %]
1200                     <th id="item_status" data-colname="item_status" class="status">Status</th>
1201                 [% IF ( itemdata_itemnotes ) %]
1202                     <th id="item_notes" data-colname="item_notes" class="notes">Notes</th>
1203                 [% END %]
1204                     <th id="item_datedue" data-colname="item_datedue" class="date_due">Date due</th>
1205                     <th id="item_barcode" data-colname="item_barcode" class="barcode">Barcode</th>
1206                 [% IF holds_count.defined %]
1207                     <th id="item_holds" data-colname="item_holds">Item holds</th>
1208                 [% ELSIF show_priority %]
1209                     <th id="item_priority" data-colname="item_priority">Item hold queue priority</th>
1210                 [% END %]
1211                 [% IF ( ShowCourseReservesHeader ) %]
1212                     <th id="item_coursereserves" data-colname="item_coursereserves">Course reserves</th>
1213                 [% END %]
1214             </tr>
1215         </thead>
1216         <tbody>
1217             [% FOREACH ITEM_RESULT IN items %]
1218                 <tr vocab="http://schema.org/" typeof="Offer">
1219
1220                 [% IF Koha.Preference('OPACLocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %]
1221                     <td class="cover">
1222                         <div class="bookcover">
1223                             <div class="cover-slider">
1224                                 [% FOR image IN ITEM_RESULT.cover_images %]
1225                                     <div class="cover-image local-coverimg">
1226                                         <a href="/cgi-bin/koha/opac-image.pl?itemnumber=[% image.itemnumber | uri %]&amp;imagenumber=[% image.imagenumber | uri %]" title="Local cover image">
1227                                             <img src="/cgi-bin/koha/opac-image.pl?thumbnail=1&amp;imagenumber=[% image.imagenumber | uri %]" alt="Local cover image" />
1228                                         </a>
1229                                     </div>
1230                                 [% END %]
1231                             </div>
1232                         </div>
1233                     </td>
1234                 [% END %]
1235
1236                 [% IF ( item_level_itypes ) %]
1237                     <td class="itype">
1238                         [% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %]
1239                             [% IF ( ITEM_RESULT.imageurl ) %]
1240                                 <img src="[% ITEM_RESULT.imageurl | html %]" title="[% ITEM_RESULT.description | html %]" alt="[% ITEM_RESULT.description | html %]" />
1241                             [% END %]
1242                         [% END %]
1243                         [% ITEM_RESULT.description | html %]
1244                     </td>
1245                 [% END %]
1246                 [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %]
1247                     <td class="location" property="seller" data-order="[% ITEM_RESULT.branchname| html %]">
1248                         <link property="itemOffered" href="#record" />
1249                         <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut">
1250
1251                         [% IF ( ITEM_RESULT.holding_branch_opac_info ) %]
1252                             <a href="[% ITEM_RESULT.branchurl | url %]" class="library_info" data-branchcode="[% ITEM_RESULT.branchcode | html %]">
1253                                 <i class="fa fa-info-circle" aria-hidden="true"></i> [% ITEM_RESULT.branchname | html %]
1254                             </a>
1255                         [% ELSIF ( ITEM_RESULT.branchurl ) %]
1256                             <a href="[% ITEM_RESULT.branchurl | url %]">
1257                                 [% ITEM_RESULT.branchname | html %]
1258                             </a>
1259                         [% ELSE %]
1260                             <span>[% ITEM_RESULT.branchname | html %]</span>
1261                         [% END %]
1262
1263                         [% IF ( Koha.Preference('OpacLocationOnDetail') == 'holding' || Koha.Preference('OpacLocationOnDetail') == 'both' ) %]
1264                             <span class="shelvingloc">[% ITEM_RESULT.location_description | html %]</span>
1265                         [% END %]
1266
1267                     </td>
1268                 [% END %]
1269
1270                 [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %]
1271                     <td class="location" property="seller">
1272                         <link property="itemOffered" href="#record" />
1273                         <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut">
1274
1275                         [% IF ( ITEM_RESULT.holding_branch_opac_info ) %]
1276                             <a href="[% Branches.GetURL( ITEM_RESULT.homebranch ) | url %]" class="library_info" data-branchcode="[% ITEM_RESULT.homebranch | html %]">
1277                                 <i class="fa fa-info-circle" aria-hidden="true"></i> [% Branches.GetName( ITEM_RESULT.homebranch ) | html %]
1278                             </a>
1279                         [% ELSIF ( Branches.GetURL( ITEM_RESULT.homebranch ) ) %]
1280                             <a href="[% Branches.GetURL( ITEM_RESULT.homebranch ) | url %]">
1281                                 [% Branches.GetName( ITEM_RESULT.homebranch ) | html %]
1282                             </a>
1283                         [% ELSE %]
1284                             <span>[% Branches.GetName( ITEM_RESULT.homebranch ) | html %]</span>
1285                         [% END %]
1286
1287                         [% IF ( Koha.Preference('OpacLocationOnDetail') == 'home' || Koha.Preference('OpacLocationOnDetail') == 'both' ) %]
1288                             <span class="shelvingloc">[% ITEM_RESULT.location_description | html %]</span>
1289                         [% END %]
1290
1291                     </td>
1292                 [% END %]
1293
1294                 [% IF ( itemdata_ccode ) %]
1295                     <td class="collection">[% ITEM_RESULT.ccode | html %]</td>
1296                 [% END %]
1297
1298                 [% IF ( Koha.Preference('OpacLocationOnDetail') == 'column' && itemdata_location ) %]
1299                     <td class="shelving_location"><span class="shelvingloc">[% ITEM_RESULT.location_description | html %]</span></td>
1300                 [% END %]
1301
1302                 <td class="call_no" property="sku">
1303                     [% IF ( ITEM_RESULT.itemcallnumber ) %]
1304                         [% ITEM_RESULT.itemcallnumber | html %]
1305                         [% IF ( OPACShelfBrowser ) %]
1306                             [% IF ( ITEM_RESULT.itemnumber == starting_itemnumber ) %]
1307                                 (<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>)
1308                             [% ELSE %]
1309                                 (<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>)
1310                             [% END %]
1311                         [% END %]
1312                     [% END %]
1313                 </td>
1314
1315                 [% UNLESS TablesSettings.is_hidden( 'opac', 'biblio-detail', 'holdingst', 'item_materials') %]
1316                     <td class="materials">[% ITEM_RESULT.materials | html %]</td>
1317                 [% END %]
1318
1319                 [% IF ( itemdata_enumchron ) %]
1320                     <td class="vol_info">
1321                         [% IF ITEM_RESULT.enumchron && ITEM_RESULT.serialseq %]
1322                             <span class="enum">[% ITEM_RESULT.enumchron | html %]</span>
1323                             [% IF ( ITEM_RESULT.serialseq && ITEM_RESULT.enumchron!=ITEM_RESULT.serialseq ) %]
1324                                 <span class="sep"> -- </span>
1325                                 <span class="serialseq">[% ITEM_RESULT.serialseq | html %]</span>
1326                             [% END %]
1327                         [% ELSIF ITEM_RESULT.enumchron %]
1328                             <span class="enum">[% ITEM_RESULT.enumchron | html %]</span>
1329                         [% ELSIF ITEM_RESULT.serialseq %]
1330                                 <span class="serialseq">[% ITEM_RESULT.serialseq | html %]</span>
1331                         [% END %]
1332                         [% IF ( ITEM_RESULT.publisheddate ) %]
1333                             <span class="pubdate">([% ITEM_RESULT.publisheddate | $KohaDates %])</span>
1334                         [% END %]
1335                     </td>
1336                 [% END %]
1337                 [% IF ( itemdata_uri ) %]
1338                     <td class="url">
1339                     [% IF ITEM_RESULT.uri %]
1340                         [%# Initialize two helper vars %]
1341                         [% SET target_attr = ''; SET rel_attr = '' %]
1342                         [% IF Koha.Preference('OPACURLOpenInNewWindow') %][% SET target_attr = '_blank'; SET rel_attr = 'noreferrer' %][% END %]
1343
1344                         [%# Check if there are multiple URIs; in the single case we only use pref URLLinkText or Link to resource %]
1345                         [% IF ITEM_RESULT.uri.split(' \| ').size > 1 %]
1346                             [% FOREACH uri IN ITEM_RESULT.uri.split(' \| ') %]
1347                                 [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
1348                                     <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>
1349                                 [% ELSE %]
1350                                     <a target="[% target_attr | html %]" rel="[% rel_attr | html %]" href="[% uri | url %]" property="url">[% uri | html %]</a>
1351                                 [% END %]
1352                             [% END %]
1353                         [% ELSE %]
1354                             [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
1355                                 <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">
1356                             [% ELSE %]
1357                                 <a target="[% target_attr | html %]" rel="[% rel_attr | html %]" href="[% ITEM_RESULT.uri | url %]" property="url">
1358                             [% END %]
1359                                 [% IF Koha.Preference('URLLinkText') %][% Koha.Preference('URLLinkText') | html %][% ELSE %]Link to resource[% END %]
1360                             </a>
1361                         [% END %]
1362                     [% END %]
1363                     </td>
1364                 [% END # /IF itemdata_uri %]
1365                 [% IF ( itemdata_copynumber ) %]<td class="copynumber">[% ITEM_RESULT.copynumber | html %]</td>[% END %]
1366                 <td class="status">[% INCLUDE 'item-status-schema-org.inc' item = ITEM_RESULT %][% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td>
1367                 [% IF ( itemdata_itemnotes ) %]<td class="notes" property="description">[% ITEM_RESULT.itemnotes | $raw %]</td>[% END %]
1368                 <td class="date_due" data-order="[% ITEM_RESULT.datedue | html %]">[% ITEM_RESULT.datedue | $KohaDates  as_due_date => 1 %]</td>
1369                     <td class="barcode" property="serialNumber">[% ITEM_RESULT.barcode | html %]</td>
1370                 [% IF holds_count.defined || show_priority %]
1371                     <td class="holds_count">
1372                         [% IF holds_count.defined %] [% ITEM_RESULT.holds_count | html %] [% END %]
1373                         [% IF ITEM_RESULT.priority %]
1374                             [% IF holds_count.defined %]
1375                                 <span>(priority [% ITEM_RESULT.priority | html %])</span>
1376                             [% ELSE %]
1377                                 <span>[% ITEM_RESULT.priority | html %]</span>
1378                             [% END %]
1379                         [% END %]
1380                     </td>
1381                 [% END %]
1382                 [% IF ShowCourseReservesHeader %]
1383                     <td>
1384                         [% IF ITEM_RESULT.course_reserves %]
1385                             [% FOREACH r IN ITEM_RESULT.course_reserves %]
1386                                 [% IF r.course.enabled == 'yes' %]
1387                                     <p>
1388                                         <a href="opac-course-details.pl?course_id=[% r.course.course_id | uri %]">
1389                                         [% r.course.course_name | html %]
1390                                         <!--[% IF r.course.course_number %] [% r.course.course_number | html %] [% END %]-->
1391                                         [% IF r.course.section %] [% r.course.section | html %] [% END %]
1392                                         [% IF r.course.term %] [% AuthorisedValues.GetByCode( 'TERM', r.course.term, 1 ) | html %] [% END %]
1393                                         </a>
1394                                     </p>
1395                                 [% END %]
1396                             [% END %]
1397                         [% END %]
1398                     </td>
1399                 [% END  # /IF ShowCourseReservesHeader %]
1400                 </tr>
1401             [% END %]
1402         </tbody>
1403     </table>
1404 [% END %][%# end of items_table block %]
1405
1406 <!-- Library Info Modal -->
1407 <div class="modal" id="libraryInfoModal" tabindex="-1" aria-labelledby="libraryInfoModalLabel" aria-hidden="true">
1408     <div class="modal-dialog">
1409         <div class="modal-content">
1410             <div class="modal-header">
1411                 <h5 class="modal-title" id="libraryInfoModalLabel"></h5>
1412                 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close">
1413                     <span aria-hidden="true">&times;</span>
1414                 </button>
1415             </div>
1416             <div class="modal-body">
1417                 <div id="libraryInfo"></div>
1418             </div>
1419             <div class="modal-footer">
1420                 <a id="libraryInfoLink" href="" class="btn btn-primary">Visit web site</a>
1421                 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
1422             </div>
1423         </div> <!-- /.modal-content -->
1424     </div> <!-- /.modal-dialog -->
1425 </div> <!-- /.modal -->
1426
1427 [% BLOCK jsinclude %]
1428     [% INCLUDE 'datatables.inc' %]
1429     [% INCLUDE 'columns_settings.inc' %]
1430     [% INCLUDE greybox.inc %]
1431     [% IF ( OpacStarRatings != 'disable' ) %][% Asset.js("lib/jquery/plugins/jquery.barrating.min.js") | $raw %][% END %]
1432
1433     [% IF ( OpacHighlightedWords ) %][% Asset.js("lib/jquery/plugins/jquery.highlight-3.js") | $raw %][% END %]
1434     [% IF ( Koha.Preference('OPACDetailQRCode') ) %]
1435         [% Asset.js("lib/kjua/kjua.min.js") | $raw %]
1436     [% END %]
1437
1438     [% Asset.js("lib/Chocolat/js/chocolat.js") | $raw %]
1439
1440     [% IF ( Koha.Preference('OPACShowMusicalInscripts') ) %]
1441         <script>
1442             var interface = "[% interface | html %]";
1443             var PREF_OPACPlayMusicalInscripts = "[% Koha.Preference('OPACPlayMusicalInscripts') | html %]";
1444         </script>
1445         [% Asset.js("js/verovio.js") | $raw %]
1446     [% END %]
1447     [% Asset.js("lib/emoji-picker/js/emoji-picker-all.min.js") | $raw %]
1448     [% IF OpenLibraryCovers || OpenLibrarySearch %]
1449         [% Asset.js("js/openlibrary.js") | $raw %]
1450     [% END %]
1451
1452     <script>
1453         window.emojiPicker = new EmojiPicker({
1454         emojiable_selector: '[data-emojiable=true]',
1455         assetsPath: '[% interface | html %]/lib/emoji-picker/img/',
1456         popupButtonClasses: 'fa fa-smile-o'
1457         });
1458         window.emojiPicker.discover();
1459
1460         var OPACPopupAuthorsSearch = "[% Koha.Preference('OPACPopupAuthorsSearch') | html %]";
1461         [% IF ( OpacHighlightedWords ) %]
1462             var q_array = new Array();  // holds search terms if available
1463
1464             function highlightOff() {
1465                 $("#catalogue_detail_biblio").removeHighlight();
1466                 $(".highlight_toggle").toggle();
1467             }
1468             function highlightOn() {
1469                 var x;
1470                 for (x in q_array) {
1471                     if ( q_array[x].length > 0 ) {
1472                         q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
1473                         q_array[x] = q_array[x].toLowerCase();
1474                         var myStopwords = "[% Koha.Preference('NotHighlightedWords') | html %]".toLowerCase().split('|');
1475                         if( $.inArray(q_array[x], myStopwords) == -1 ) {
1476                             $(".title").highlight(q_array[x]);
1477                             $(".author").highlight(q_array[x]);
1478                             $(".results_summary").highlight(q_array[x]);
1479                         }
1480                     }
1481                     $(".highlight_toggle").toggle();
1482                 }
1483             }
1484         [% END # /IF OpacHighlightedWords %]
1485
1486         function verify_cover_images() {
1487             // Loop over each container in the template which contains covers
1488             $(".cover-slider").each(function( index ){
1489                 var lightbox_descriptions = [];
1490                 var first_shown = 0;
1491                 $(this).find(".cover-image").each( function( index ){
1492                     var div = $(this);
1493                     // Find the image in the container
1494                     var img = div.find("img")[0];
1495                     if( img && $(img).length > 0 ){
1496                         var description = "";
1497                         if( img.naturalHeight == 0 && div.attr("id") != "googlejacket-coverimg" ){
1498                             // No image loaded in the container. Remove the slide
1499                             div.remove();
1500                         } else {
1501                             // All slides start hidden. If this is the first one, show it.
1502                             if( first_shown == 0 ){
1503                                 div.show();
1504                                 first_shown = 1;
1505                             }
1506                             // Check if Amazon image is present
1507                             if ( div.attr("id") == "amazon-bookcoverimg"  ) {
1508                                 w = img.width;
1509                                 h = img.height;
1510                                 if ((w == 1) || (h == 1)) {
1511                                     // Amazon returned single-pixel placeholder
1512                                     // Remove the container
1513                                     div.remove();
1514                                 } else {
1515                                     lightbox_descriptions.push(_("Amazon cover image (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1516                                 }
1517                             } else if( div.attr("id") == "custom-coverimg" ){
1518                                 if ( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ) {
1519                                     // No image was loaded via the CustomCoverImages system preference
1520                                     // Remove the container
1521                                     div.remove();
1522                                 } else {
1523                                     lightbox_descriptions.push(_("Custom cover image"));
1524                                 }
1525                             } else if( div.attr("id") == "syndetics-coverimg" ){
1526                                 lightbox_descriptions.push(_("Image from Syndetics"))
1527                             } else if( div.attr("id") == "googlejacket-coverimg" ){
1528                                 lightbox_descriptions.push(_("Image from Google Books (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1529                             } else if( div.attr("id") == "openlibrary-coverimg" ){
1530                                 lightbox_descriptions.push(_("Image from OpenLibrary (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1531                             } else if( div.attr("id") == "coce-coverimg" ){
1532                                 // Identify which service's image is being loaded by Coce
1533                                 var coce_description;
1534                                 if( $(img).attr("src").indexOf('amazon.com') >= 0 ){
1535                                     coce_description = _("Coce image from Amazon.com");
1536                                 } else if( $(img).attr("src").indexOf('google.com') >= 0 ){
1537                                     coce_description = _("Coce image from Google Books");
1538                                 } else if( $(img).attr("src").indexOf('openlibrary.org') >= 0 ){
1539                                     coce_description = _("Coce image from Open Library");
1540                                 }
1541                                 div.find(".hint").html(coce_description);
1542                                 lightbox_descriptions.push(coce_description);
1543                             } else if ( div.attr("id") == "bakertaylor-coverimg" ){
1544                                 lightbox_descriptions.push(_("Image from Baker &amp; Taylor"));
1545                             } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1546                                 lightbox_descriptions.push(_("Local cover image"));
1547                             } else {
1548                                 lightbox_descriptions.push(_("Cover image source unknown"));
1549                             }
1550                         }
1551                     } else {
1552                         div.remove();
1553                     }
1554                 });
1555
1556                 // Lightbox for cover images
1557                 Chocolat(this.querySelectorAll('.cover-image a'), {
1558                     description: function(){
1559                         return lightbox_descriptions[this.settings.currentImageIndex];
1560                     }
1561                 });
1562
1563             });
1564
1565             $(".cover-slider").each(function(){
1566                 var coverSlide = this;
1567                 var coverImages = $(this).find(".cover-image");
1568                 if( coverImages.length > 1 ){
1569                     coverImages.each(function( index ){
1570                         // If more that one image is present, add a navigation link
1571                         // for activating the slide
1572                         var covernav = $("<a href=\"#\" data-num=\"" + index + "\" class=\"cover-nav\"></a>");
1573                         if( index == 0 ){
1574                             // Set the first navigation link as active
1575                             $(covernav).addClass("nav-active");
1576                         }
1577                         $(covernav).html("<i class=\"fa fa-circle\"></i>");
1578                         $(coverSlide).append( covernav );
1579                     });
1580                 }
1581
1582                 if( $(coverSlide).find(".cover-image:visible").length < 1 ){
1583                     $(coverSlide).remove();
1584                 } else {
1585                     $(coverSlide).addClass("cover-slides");
1586                 }
1587             });
1588
1589             $(".cover-slider").on("click",".cover-nav", function(e){
1590                 e.preventDefault();
1591                 var cover_slider = $(this).parent();
1592                 // Adding click handler for cover image navigation links
1593                 var num = $(this).data("num");
1594                 $(cover_slider).find(".cover-nav").removeClass("nav-active");
1595                 $(this).addClass("nav-active");
1596                 $(cover_slider).find(".cover-image").hide();
1597                 $(cover_slider).find(".cover-image").eq( num ).show();
1598             });
1599
1600             $("#editions img").each(function(i){
1601                 if ( this.src.indexOf('amazon.com') >= 0 ) {
1602                     w = this.width;
1603                     h = this.height;
1604                     if ((w == 1) || (h == 1)) {
1605                         this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1606                     } else if ( (this.complete != null) && (!this.complete) || this.naturalHeight == 0 ) {
1607                         this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1608                     }
1609                 }
1610             });
1611         } /* /verify_images */
1612
1613         let counter_wait = 0;
1614         function wait_for_images(cb){
1615
1616             var loaded = 1;
1617             counter_wait++;
1618
1619             [% IF GoogleJackets %]
1620                 if ( loaded ) {
1621                     loaded = KOHA.Google.done;
1622                 }
1623             [% END %]
1624
1625             [% IF OpenLibraryCovers %]
1626                 if ( loaded ) {
1627                     loaded = KOHA.OpenLibrary.done;
1628                 }
1629             [% END %]
1630
1631             [% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %]
1632                 if ( loaded ) {
1633                     loaded = KOHA.coce.done;
1634                 }
1635             [% END %]
1636
1637             if (!loaded && counter_wait < 50) {// Do not wait more than 5 seconds
1638                 window.setTimeout(function(){wait_for_images(cb);}, 100);
1639             } else {
1640                 if (counter_wait >= 50 ) {
1641                     console.log("Could not retrieve the images")
1642                 }
1643                 cb();
1644             }
1645         }
1646
1647         $(window).load(function() {
1648             wait_for_images(verify_cover_images);
1649         });
1650
1651         $(document).ready(function() {
1652
1653             [% IF ( Koha.Preference('OPACDetailQRCode') ) %]
1654
1655                 var qrcode = kjua({
1656                     ecLevel: "H",
1657                     render: "canvas",
1658                     rounded: 100,
1659                     size: 150,
1660                     text: location.href,
1661                 });
1662                 if (qrcode) {
1663                     document.getElementById("qrcode").appendChild( qrcode );
1664                 }
1665
1666                 $(".show_qrcode").on("click", function(){
1667                     var qrcodeImg = $("#qrcode");
1668                     if( qrcodeImg.hasClass("d-none") ){
1669                         qrcodeImg.removeClass("d-none");
1670                     } else {
1671                         qrcodeImg.addClass("d-none");
1672                     }
1673                 });
1674             [% END # /IF OPACDetailQRCode %]
1675
1676             [% SWITCH defaulttab -%]
1677             [%   CASE 'holdings' -%]
1678                 showBsTab("bibliodescriptions", "holdings");
1679             [%   CASE 'components' -%]
1680                 showBsTab("bibliodescriptions", "components");
1681             [%   CASE 'subscriptions' -%]
1682                 showBsTab("bibliodescriptions", "subscriptions");
1683             [%   CASE 'serialcollection' -%]
1684                 showBsTab("bibliodescriptions", "serialcollection");
1685             [%   CASE 'media' -%]
1686                 showBsTab("bibliodescriptions", "html5media");
1687             [%   CASE  -%]
1688                 showBsTab("bibliodescriptions", "holdings");
1689             [% END -%]
1690
1691             [% IF ( Koha.Preference('OpacBrowseResults') && busc ) %]
1692                 $(".l_Results").show();
1693                 $("#a_listResults").on("click", function(e){
1694                     e.preventDefault();
1695                     $(".results-pagination, .close_pagination, .pg_menu").toggle();
1696                 });
1697
1698                 $(".close_pagination").on("click", function(e){
1699                     e.preventDefault();
1700                     $(".results-pagination, .close_pagination, .pg_menu").toggle();
1701                 });
1702             [% END # /IF OpacBrowseResults %]
1703
1704             var columns_settings = [% TablesSettings.GetColumns( 'opac', 'biblio-detail', 'holdingst', 'json' ) | $raw %];
1705
1706             KohaTable("#holdingst", {
1707                 dom: '<"clearfix">t',
1708                 "columnDefs": [
1709                     { "targets": [ -1 ], "sortable": false, "searchable": false },
1710                     ],
1711                 "bKohaColumnsUseNames": true,
1712                 "autoWidth": false
1713             }, columns_settings);
1714
1715             KohaTable("#otherholdingst", {
1716                 dom: '<"clearfix">t',
1717                 "columnDefs": [
1718                     { "targets": [ -1 ], "sortable": false, "searchable": false },
1719                     ],
1720                 "bKohaColumnsUseNames": true,
1721                 "autoWidth": false
1722             }, columns_settings);
1723
1724             var serial_column_settings = [% TablesSettings.GetColumns( 'opac', 'biblio-detail', 'subscriptionst', 'json' ) | $raw %];
1725
1726             KohaTable("#subscriptionst", {
1727                 dom: '<"clearfix">t',
1728                 "sorting": [[ 1, "desc" ]],
1729                 "autoWidth": false,
1730                 "bKohaColumnsUseNames": true
1731             }, serial_column_settings);
1732
1733             [% IF ( TagsInputEnabled && loggedinusername ) %]
1734                     $(".tag_add").click(function(){
1735                         var thisid = $(this).attr("id");
1736                         thisid = thisid.replace("tag_add","");
1737                         $(this).hide();
1738                         $("#tagform"+thisid).show();
1739                         $("#newtag"+thisid).focus();
1740                         $("#newtag"+thisid+"_status").empty().hide();
1741                         return false;
1742                     });
1743                     $(".cancel_tag_add").click(function(){
1744                         var thisid = $(this).attr("id");
1745                         thisid = thisid.replace("cancel","");
1746                         $("#tagform"+thisid).hide();
1747                         $("#tag_add"+thisid).show();
1748                         $("#newtag"+thisid).val("");
1749                         $("#newtag"+thisid+"_status").empty().hide();
1750                         return false;
1751                     });
1752                     $(".tagbutton").click(function(){
1753                         var thisid = $(this).attr("title");
1754                         var tag = $("#newtag"+thisid).val();
1755                         if (!tag || (tag == "")) {
1756                             alert(MSG_NO_TAG_SPECIFIED);
1757                             return false;
1758                         }
1759                         KOHA.Tags.add_tag_button(thisid, tag);
1760                         return false;
1761                     });
1762             [% END %]
1763
1764             [%# Note that there is no way atm to target a column with its class name to set it as the default sort order %]
1765             [% 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 %]
1766                 var default_order_index = 1;
1767             [% ELSIF Koha.Preference('OpacLocationBranchToDisplay') == 'both' AND Koha.Preference('OPACHoldingsDefaultSortField') == 'homebranch' AND item_level_itypes %]
1768                 var default_order_index = 2;
1769             [% ELSE %]
1770                 var default_order_index = 0;
1771             [% END %]
1772
1773             [% IF ( query_desc ) %]
1774                 [% IF ( OpacHighlightedWords ) %]
1775                     var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') | html %]";
1776                     q_array = query_desc.split(" ");
1777                     q_array = q_array.filter(function(n){ return n }); // Remove empty strings
1778                     highlightOn();
1779                     $("#highlight_toggle_on" ).hide().click(function() {highlightOn() ; return false;});
1780                     $("#highlight_toggle_off").show().click(function() {highlightOff(); return false;});
1781                 [% END %]
1782             [% END %]
1783
1784             [% IF ( GoogleJackets ) %]
1785                 KOHA.Google.GetCoverFromIsbn([% covernewwindow | html %]);
1786             [% END %]
1787
1788             [% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %]
1789                 KOHA.coce.getURL('[% Koha.Preference('CoceHost') | html %]', '[% Koha.Preference('CoceProviders') | html %]',[% covernewwindow | html %]);
1790             [% END %]
1791
1792             [% IF OpenLibraryCovers %]
1793                 KOHA.OpenLibrary.GetCoverFromIsbn();
1794             [% END %]
1795
1796             [% IF ( NovelistSelectProfile && ( normalized_isbn || normalized_upc ) ) %]
1797                 novSelect.loadContentForQuery(
1798                     {
1799                         ClientIdentifier : '[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]',
1800                         ISBN : '[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]',
1801                         version : '2.1'
1802                     },
1803                     '[% NovelistSelectProfile | html %]',
1804                     '[% NovelistSelectPassword | html %]',
1805                     function(d){
1806                         if ( d.length > 0 ){ //If no content
1807                             $(".NovelistSelect").show();
1808                         }
1809                     });
1810             [% END %]
1811
1812             [% IF ( OPACShelfBrowser ) %]
1813                 // Focus on shelf browser if present
1814                 var shelfbrowser = $("#shelfbrowser");
1815                 if (shelfbrowser.length > 0) {
1816                     $('html,body').animate({
1817                         scrollTop: shelfbrowser.first().offset().top
1818                     },
1819                     'slow');
1820                     shelfbrowser.first().find(':focusable').eq(0).focus();
1821                 }
1822
1823                 (function prepareShelfBrowser(){
1824
1825                     $(".main").on("click",".close_shelf",function(e){
1826                         e.preventDefault();
1827                         $("#shelfbrowser").toggle();
1828                     });
1829                     $(".main").on("click", "#browser_previous a", function(e){
1830                         e.preventDefault();
1831                         $.ajax({
1832                             url: "/cgi-bin/koha/svc/shelfbrowser.pl",
1833                             type: "POST",
1834                             data: {
1835                                 "shelfbrowse_itemnumber": $("#browser_previous a").data( "prev-itemnumber" )
1836                             },
1837                             success: function(data){
1838                                 $("#shelfbrowser").replaceWith(data);
1839                                 [% IF ( GoogleJackets ) %]
1840                                     KOHA.Google.GetCoverFromIsbn([% covernewwindow | html %]);
1841                                 [% END %]
1842                                 [% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %]
1843                                     KOHA.coce.getURL('[% Koha.Preference('CoceHost') | html %]', '[% Koha.Preference('CoceProviders') | html %]',[% covernewwindow | html %]);
1844                                 [% END %]
1845                                 [% IF OpenLibraryCovers %]
1846                                     KOHA.OpenLibrary.GetCoverFromIsbn();
1847                                 [% END %]
1848                                 [% IF OPACLocalCoverImages %]
1849                                     KOHA.LocalCover.GetCoverFromBibnumber(true);
1850                                 [% END %]
1851                             }
1852                         });
1853                     });
1854
1855                     $(".main").on("click", "#browser_next a", function(e){
1856                         e.preventDefault();
1857                         $.ajax({
1858                             url: "/cgi-bin/koha/svc/shelfbrowser.pl",
1859                             type: "POST",
1860                             data: {
1861                                 "shelfbrowse_itemnumber": $("#browser_next a").data( "next-itemnumber" )
1862                             },
1863                             success: function(data){
1864                                 $("#shelfbrowser").replaceWith(data);
1865                                 [% IF ( GoogleJackets ) %]
1866                                     KOHA.Google.GetCoverFromIsbn([% covernewwindow | html %]);
1867                                 [% END %]
1868                                 [% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %]
1869                                     KOHA.coce.getURL('[% Koha.Preference('CoceHost') | html %]', '[% Koha.Preference('CoceProviders') | html %]',[% covernewwindow | html %]);
1870                                 [% END %]
1871                                 [% IF OpenLibraryCovers %]
1872                                     KOHA.OpenLibrary.GetCoverFromIsbn();
1873                                 [% END %]
1874                                 [% IF OPACLocalCoverImages %]
1875                                     KOHA.LocalCover.GetCoverFromBibnumber(true);
1876                                 [% END %]
1877                             }
1878                         });
1879                     });
1880                 }());
1881             [% END # /IF ( OPACShelfBrowser ) %]
1882
1883             [% IF ( OpacStarRatings != 'disable' ) %]
1884                 // -----------------------------------------------------
1885                 // star-ratings code
1886                 // -----------------------------------------------------
1887                 // hide 'rate' button if javascript enabled
1888
1889                 $('input[name="rate_button"]').remove();
1890
1891                 var rating_enabled = ( $("#star_rating").data("rating-enabled") == "1" ) ? false : true;
1892                 $('#star_rating').barrating({
1893                     theme: 'fontawesome-stars',
1894                     showSelectedRating: false,
1895                     allowEmpty: true,
1896                     deselectable: false,
1897                     readonly: rating_enabled,
1898                     onSelect: function(value, text) {
1899                         $("#rating-loading").show();
1900                         $.post("/cgi-bin/koha/opac-ratings-ajax.pl", {
1901                             rating_old_value: $("#rating_value").attr("value"),
1902                             borrowernumber: "[% borrowernumber | html %]",
1903                             biblionumber: "[% biblio.biblionumber | html %]",
1904                             rating_value: value,
1905                             auth_error: value
1906                         }, function (data) {
1907                                 $("#rating_value").val(data.rating_value);
1908                                 if (data.rating_value) {
1909                                     $("#rating_value_text").text(_("Your rating: %s, ").format(data.rating_value));
1910                                     $("#cancel_rating_text").show();
1911                                 } else {
1912                                     $("#rating_value_text").text('');
1913                                     $("#cancel_rating_text").hide();
1914                                 }
1915                                 $("#rating_text").text(_("Average rating: %s (%s votes)").format(data.rating_avg, data.rating_total));
1916                                 $("#rating-loading").hide();
1917                         }, "json");
1918                     }
1919                 });
1920
1921                 $("#cancel_rating_text a").on("click", function(e){
1922                     e.preventDefault();
1923                     $("#star_rating").barrating("set", "");
1924                 });
1925
1926             [% END # / IF ( OpacStarRatings != 'disable' )%]
1927         });
1928
1929         $(document).ready(function() {
1930             if( OPACPopupAuthorsSearch == "1" ){
1931                 var terms = {
1932                     contributors : {
1933                         "label" : "author",
1934                         "keyword_search" : "au:",
1935                     },
1936                     subject : {
1937                         "label" : "subject",
1938                         "keyword_search" : "su:",
1939                     }
1940                 }
1941                 $(".contributors,.subject").on("click", function(e){
1942                     e.preventDefault();
1943                     var term = $(this).attr("class");
1944                     var selected_term = $(this).text();
1945                     var term_links = $("." + term );
1946                     if( term_links.length > 1 ){
1947                         term_links.each(function( index ){
1948                             var authid = "";
1949                             var preselected = false;
1950                             var search_label = $(this).text().trim();
1951                             if( $(this).text() == selected_term ){ preselected = true }
1952                             if( $(this).hasClass("authority_link") ){
1953                                 authid = $(this).data("authid");
1954                                 search_string = "an:" + authid;
1955                             } else {
1956                                 search_string = terms[term]["keyword_search"] + encodeURIComponent( search_label );
1957                             }
1958                             var termLink = $("<li>")
1959                                 .append( $("<input>", { type: "checkbox", class: "select_term", value: search_string, id: terms[term]["label"] + index } ).prop("checked", preselected ) )
1960                                 .append("&nbsp;")
1961                                 .append( $("<label>", { for: terms[term]["label"] + index, text: search_label } ) )
1962                             $("#termsList").append( termLink );
1963                             $("#multiSearch").modal("show");
1964                         });
1965                     } else {
1966                         location.href = $(this).attr("href");
1967                     }
1968                 });
1969
1970                 $("#multiSearch").on("hide.bs.modal", function(){
1971                     $("#termsList").html("");
1972                 });
1973
1974                 $(".check_all").on("click", function(e){
1975                     e.preventDefault();
1976                     $(".select_term").each(function(){
1977                         $(this).prop("checked", true );
1978                     });
1979                 });
1980
1981                 $(".check_none").on("click", function(e){
1982                     e.preventDefault();
1983                     $(".select_term").each(function(){
1984                         $(this).prop("checked", false );
1985                     });
1986                 });
1987
1988                 $("#validMultiSearch").on("click", function(e){
1989                     e.preventDefault();
1990                     multiSearchRequest();
1991                 });
1992             } /* if( OPACPopupAuthorsSearch == "1" ) */
1993
1994             $(".library_info").on("click", function(e){
1995                 e.preventDefault();
1996                 var branchcode = $(this).data("branchcode");
1997                 var url = $(this).attr("href");
1998                 $.ajax({
1999                     url: "/api/v1/public/libraries/" + branchcode,
2000                     type: 'GET',
2001                     dataType: 'json',
2002                     success: function(result) {
2003                         $("#libraryInfoModalLabel").html( result.name );
2004                         $("#libraryInfo").html( result.opac_info );
2005                         if( result.url ){
2006                             $("#libraryInfoLink").attr("href", result.url );
2007                             $("#libraryInfoLink").show();
2008                         } else {
2009                             $("#libraryInfoLink").hide();
2010                         }
2011                         $("#libraryInfoModal").modal("show");
2012                     },
2013                     error: function(xhr, status, error) {
2014                         if( url ){
2015                             location.href = url;
2016                         }
2017                     }
2018                 });
2019             });
2020             $("#libraryInfoModal").on("hide.bs.modal", function(){
2021                 $("#libraryInfoModalLabel, #libraryInfo").html("");
2022                 $("#libraryInfoLink").attr("href", "");
2023             });
2024         });
2025
2026         function showBsTab( container, panelid ){
2027             if( $( "#" + panelid ).length == 1 ){
2028                 $("#" + container + " a[href='#" + panelid + "']").tab("show");
2029             } else {
2030                 $("#" + container + " a:first").tab("show");
2031             }
2032         }
2033
2034         function multiSearchRequest(){
2035             var values = [];
2036             $(".select_term").each(function(){
2037                 if( $(this).prop("checked") ){
2038                     values.push( $(this).val() );
2039                 }
2040             });
2041
2042             if (values.length > 0) {
2043                 var request = "/cgi-bin/koha/opac-search.pl?q=" + values.join(' and ');
2044                 location.href = request;
2045             }
2046
2047         }
2048     </script>
2049 [% END %]