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