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