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