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