Bug 19855: Remove $type from the alerts
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-detail.tt
index ee6120e..26fed4e 100644 (file)
@@ -1,9 +1,17 @@
+[% USE Asset %]
+[% USE Math %]
 [% USE Koha %]
 [% USE KohaDates %]
 [% USE Branches %]
+[% USE ColumnsSettings %]
 [% USE AuthorisedValues %]
 [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnDetail ) %]
 [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnDetail ) %]
+[% IF Koha.Preference('AmazonAssocTag') %]
+    [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %]
+[% ELSE %]
+    [% AmazonAssocTag = '' %]
+[% END %]
 
 [% ShowCourseReservesHeader = 0 %]
 [% IF Koha.Preference( 'UseCourseReserves' ) == 1 %]
     [% SET protocol = "http://" %]
 [% END %]
 [% INCLUDE 'doc-head-open.inc' %]
-<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Details for: [% title |html %][% FOREACH subtitl IN subtitle %], [% subtitl.subfield |html %][% END %]</title>
+<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Details for: [% title |html %][% FOREACH subtitl IN subtitle %][% IF Koha.Preference('marcflavour')=='UNIMARC' %],[% END %] [% subtitl.subfield |html %][% END %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 [% IF ( bidi ) %]
-  [% BLOCK cssinclude %]<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/right-to-left.css" />[% END %]
+  [% BLOCK cssinclude %][% Asset.css("css/right-to-left.css") %][% END %]
 [% END %]
 [% IF ( OpacStarRatings != 'disable' ) %]
-    [% BLOCK cssinclude %]<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/jquery.rating.css" />[% END %]
+    [% BLOCK cssinclude %][% Asset.css("css/jquery.rating.css") %][% END %]
 [% END %]
 [% INCLUDE greybox.inc %]
+    [% Asset.css("lib/emoji-picker/css/emoji.css") %]
 </head>
 [% INCLUDE 'bodytag.inc' bodyid='opac-detail' bodyclass='scrollto' %]
 [% INCLUDE 'masthead.inc' %]
@@ -40,7 +49,7 @@
 <div class="main">
     <ul class="breadcrumb">
         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
-        <li><a href="#">Details for: [% title |html %][% FOREACH subtitl IN subtitle %], [% subtitl.subfield |html %][% END %]</a></li>
+        <li><a href="#"><span>Details for: </span>[% title |html %][% FOREACH subtitl IN subtitle %][% IF Koha.Preference('marcflavour')=='UNIMARC' %],[% END %] [% subtitl.subfield |html %][% END %]</a></li>
     </ul>
 
     <div class="container-fluid">
 
                     <div id="bookcover">
                     [% IF ( OPACLocalCoverImages ) %]
-                        <div title="[% biblionumber |url %]" class="[% biblionumber %]" id="local-thumbnail-preview"></div>
+                        <div title="[% biblio.biblionumber %]" class="[% biblio.biblionumber %]" id="local-thumbnail-preview"></div>
                     [% END %]
                     [% IF ( OPACAmazonCoverImages ) %]
                         [% IF ( OPACURLOpenInNewWindow ) %]
-                            <a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link" target="_blank">
+                            <a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %][% AmazonAssocTag %]#reader-link" target="_blank" rel="noreferrer">
                         [% ELSE %]
-                            <a href="http://www.amazon[% AmazonTld %]/dp/[% normalized_isbn %]">
+                            <a href="http://www.amazon[% AmazonTld %]/dp/[% normalized_isbn %][% AmazonAssocTag %]">
                         [% END %]
                             <img border="0" src="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="Cover image" /></a>
                     [% END %]
                     [% END %]
 
                     [% IF ( GoogleJackets ) %]
-                        <div title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="gbs-thumbnail-preview"></div>
+                        <div title="[% biblio.biblionumber %]" class="[% normalized_isbn %]" id="gbs-thumbnail-preview"></div>
                     [% END %]
                     [% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %]
                       [% coce_id = normalized_ean || normalized_isbn %]
-                      <div style="block" title="[% biblionumber |url %]" class="[% coce_id %]" id="coce-thumbnail-preview"></div>
+                      <div style="block" title="[% biblio.biblionumber %]" class="[% coce_id %]" id="coce-thumbnail-preview"></div>
                     [% END %]
                     [% IF OpenLibraryCovers %]
-                        <div title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="openlibrary-thumbnail-preview"></div>
+                        <div title="[% biblio.biblionumber %]" class="[% normalized_isbn %]" id="openlibrary-thumbnail-preview"></div>
                     [% END %]
                     [% bt_id = ( normalized_upc || normalized_isbn ) %]
                     [% IF ( BakerTaylorEnabled && bt_id ) %]
                         [% IF BakerTaylorBookstoreURL %]
                             [% IF ( OPACURLOpenInNewWindow ) %]
-                                <a href="https://[% BakerTaylorBookstoreURL |html %][% bt_id %]" target="_blank"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% bt_id %]" /></a>
+                                <a href="https://[% BakerTaylorBookstoreURL |html %][% bt_id %]" target="_blank" rel="noreferrer"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% bt_id %]" /></a>
                             [% ELSE %]
                                 <a href="https://[% BakerTaylorBookstoreURL |html %][% bt_id %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% bt_id %]" /></a>
                             [% END %]
                     [% END %]
                     </div><!-- / #bookcover -->
 
-                    <abbr class="unapi-id" title="koha:biblionumber:[% biblionumber %]"><!-- unAPI --></abbr>
+                    <abbr class="unapi-id" title="koha:biblionumber:[% biblio.biblionumber %]"><!-- unAPI --></abbr>
                     [% IF ( ocoins ) # COinS / Openurl %]
                         <span class="Z3988" title="[% ocoins %]"></span>
                     [% END %]
 
                     <div id="views">
-                        <span class="view"><span id="Normalview">Normal view</span></span>
-                        <span class="view"><a id="MARCview" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% biblionumber %]">MARC view</a></span>
-                        [% IF ( ISBD ) %]<span class="view"><a id="ISBDview" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% biblionumber %]">ISBD view</a></span>[% END %]
+                        <span class="view current-view"><span id="Normalview">Normal view</span></span>
+                        <span class="view"><a id="MARCview" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% biblio.biblionumber %]">MARC view</a></span>
+                        [% IF ( ISBD ) %]<span class="view"><a id="ISBDview" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% biblio.biblionumber %]">ISBD view</a></span>[% END %]
                     </div>
                     [% IF ( OPACXSLTDetailsDisplay ) %]
                         [% XSLTBloc %]
                         [% IF ( collectiontitle ) %]
                             <span class="results_summary collection"><span class="label">Collection: </span>
                                 [% collectiontitle %]
-                                [% IF ( collectionissn ) %], ISSN [% collectionissn %]    [% END %]
-                                [% IF ( collectionvolume ) %]; [% collectionvolume %] [% END %]
+                                [% IF ( collectionissn ) %] [% ', ISSN ' _  collectionissn %][% END %]
+                                [% IF ( collectionvolume ) %] [% ' ; ' _ collectionvolume %] [% END %]
 
                             </span>
                         [% END %]
                                     [% FOREACH SUBFIELD IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %]
                                         [% SUBFIELD.separator %]
                                         [% IF Koha.Preference( 'OPACPopupAuthorsSearch' ) == 1 %]
-                                            <a role="button" data-toggle="modal" title="$[% SUBFIELD.code %] [% SUBFIELD.value %]" 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 %], [% loop.count %]); return false;">[% SUBFIELD.value %]</a>
+                                            <a role="button" data-toggle="modal" title="[% '$' _ SUBFIELD.code _ ' ' _ SUBFIELD.value %]" 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 %], [% loop.count %]); return false;">[% SUBFIELD.value %]</a>
                                         [% ELSE %]
-                                            <a title="$[% SUBFIELD.code %] [% SUBFIELD.value %]" 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 %]</a>
+                                            <a title="[% '$' _ SUBFIELD.code _ ' ' _ SUBFIELD.value %]" 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 %]</a>
                                         [% END %]
                                     [% END %]
                                     [% IF (MARCSUBJCT.authoritylink) %]
 
                                         [% IF ( OPACURLOpenInNewWindow ) %]
                                             [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
-                                                <a href="/cgi-bin/koha/tracklinks.pl?uri=[% MARCurl.MARCURL |url%]&amp;biblionumber=[% biblionumber | url %]" title="[% MARCurl.MARCURL %]" target="_blank">
+                                                <a href="/cgi-bin/koha/tracklinks.pl?uri=[% MARCurl.MARCURL |url%]&amp;biblionumber=[% biblio.biblionumber %]" title="[% MARCurl.MARCURL %]" target="_blank" rel="noreferrer">
                                             [% ELSE %]
-                                                <a href="[% MARCurl.MARCURL %]" title="[% MARCurl.MARCURL %]" target="_blank">
+                                                <a href="[% MARCurl.MARCURL %]" title="[% MARCurl.MARCURL %]" target="_blank" rel="noreferrer">
                                             [% END %]
                                         [% ELSE %]
                                             [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
-                                                <a href="/cgi-bin/koha/tracklinks.pl?uri=[% MARCurl.MARCURL |url%]&amp;biblionumber=[% biblionumber | url %]" title="[% MARCurl.MARCURL %]">
+                                                <a href="/cgi-bin/koha/tracklinks.pl?uri=[% MARCurl.MARCURL |url%]&amp;biblionumber=[% biblio.biblionumber %]" title="[% MARCurl.MARCURL %]">
                                             [% ELSE %]
                                                 <a href="[% MARCurl.MARCURL %]" title="[% MARCurl.MARCURL %]">
                                             [% END %]
                                         [% END %]
-
                                         [% MARCurl.linktext %]</a>
                                             [% IF ( MARCurl.notes ) %]
                                                 <ul>
                         [% END # / IF MARCURLS %]
                     [% END # / IF OPACXSLTDetailsDisplay %]
 
-                    [% IF ( AuthorisedValueImages && authorised_value_images ) %]
-                        <div class="authorised_value_images">
-                            [% FOREACH authorised_value_image IN authorised_value_images %]
-                                <img src="[% authorised_value_image.imageurl %]" alt="[% authorised_value_image.label %]" title="[% authorised_value_image.label %]" />
-                            [% END %]
-                        </div>
-                    [% END # / AuthorisedValueImages && authorised_value_images %]
-
                     <!-- This puts the LTFL reviews in, and if TabbedView is not set, puts the remaining content above the Tabs instead of in them -->
                     [% IF ( LibraryThingForLibrariesID ) %]
                         [% UNLESS ( LibraryThingForLibrariesTabbedView ) %]
 
                     [% IF ( TagsShowEnabled ) %]
                         <div class="results_summary tags">
-                        [% IF ( TagLoop ) %]
-                            <span class="label">Tags from this library:</span>
-                            <ul id="tagslist">
-                                [% FOREACH TagLoo IN TagLoop %]
-                                    <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 %])</span>
-                                    [% IF ( loop.last ) %][% ELSE %], [% END %]
-                                    </li>
-                                [% END %]
-                            </ul>
-                        [% ELSE %]
-                            <span class="label">Tags from this library:</span> <span class="notags">No tags from this library for this title.</span>
-                        [% END %]
-                        [% IF ( TagsInputEnabled ) %] <a class="tag_add" id="tag_add[% biblionumber %]" href="#">Add tag(s)</a> [% END %]
-                        </div>
-                    [% END # /IF TagsShowEnabled %]
-
-                    [% IF ( TagsInputEnabled ) %]
-                      <div class="results_summary tagsinput">
-                            [% IF ( loggedinusername ) %]
-                                <form id="tagform[% biblionumber %]" method="post" action="/cgi-bin/koha/opac-tags.pl" style="display:none;">
-                                    <label for="newtag[% biblionumber %]">New tag(s), separated by a comma:</label>
-                                    <input name="newtag[% biblionumber %]" id="newtag[% biblionumber %]" maxlength="100" type="text"/>
-                                    <input name="tagbutton" class="btn btn-small tagbutton" title="[% biblionumber %]" type="submit" value="Add" />
-                                    <a class="cancel_tag_add" id="cancel[% biblionumber %]" href="#">(done)</a>
-                                </form>
-                                <span id="newtag[% biblionumber %]_status" class="tagstatus" style="display:none;">
-                                    Tag status here.
-                                </span>
+                            [% IF ( TagLoop ) %]
+                                <span class="label">Tags from this library:</span>
+                                <ul id="tagslist">
+                                    [% FOREACH TagLoo IN TagLoop %]
+                                        <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 %])</span>
+                                        [% IF ( loop.last ) %][% ELSE %], [% END %]
+                                        </li>
+                                    [% END %]
+                                </ul>
                             [% ELSE %]
-                                <span id="login4tags">Log in to add tags.</span>
+                                <span class="label">Tags from this library:</span> <span class="notags">No tags from this library for this title.</span>
                             [% END %]
+                            [% IF ( TagsInputEnabled ) %]
+                                [% IF ( loggedinusername ) %]
+                                    <form id="tagform[% biblio.biblionumber %]" method="post" action="/cgi-bin/koha/opac-tags.pl" style="display:none;">
+                                        <label for="newtag[% biblio.biblionumber %]">New tag(s), separated by a comma:</label>
+                                        <p class="emoji-picker-container">
+                                          <input
+                                            name="newtag[% biblio.biblionumber %]"
+                                            id="newtag[% biblio.biblionumber %]"
+                                            type="text"
+                                            maxlength="100"
+                                            data-emojiable="true"
+                                            data-emoji-input="unicode">
+                                        </p>
+                                        <input name="tagbutton" class="btn btn-small tagbutton" title="[% biblio.biblionumber %]" type="submit" value="Add" />
+                                        <a class="cancel_tag_add" id="cancel[% biblio.biblionumber %]" href="#">(done)</a>
+                                    </form>
+
+                                    <span id="newtag[% biblio.biblionumber %]_status" class="tagstatus" style="display:none;">
+                                        Tag status here.
+                                    </span>
+                                    <a class="tag_add" id="tag_add[% biblio.biblionumber %]" href="#">Add tag(s)</a>
+                                [% ELSE %]
+                                    <span id="login4tags">
+                                        [% IF Koha.Preference('casAuthentication') %]
+                                            [%# CAS authentication is too complicated for modal window %]
+                                            <a href="/cgi-bin/koha/opac-user.pl">Log in to add tags.</a>
+                                        [% ELSE %]
+                                            <a class="loginModal-trigger" data-toggle="modal" role="button" href="/cgi-bin/koha/opac-user.pl">Log in to add tags.</a>
+                                        [% END %]
+                                    </span>
+                                [% END %]
+                            [% END # / IF TagsInputEnabled %]
                         </div>
-                    [% END # / IF TagsInputEnabled %]
+                    [% END # /IF TagsShowEnabled %]
 
                     [% IF ( SyndeticsEnabled ) %]
                         [% IF ( SyndeticsSeries && SyndeticsSERIES1Exists ) %]
                             <span class="results_summary">
                                 <span class="label">Series information:</span>
                                 [% IF ( using_https ) %]
-                                    <a target="_blank" href="https://secure.syndetics.com/ffseries.aspx?isbn=[% normalized_isbn %]&amp;type=series&amp;num=1&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]">Click to open in new window</a>
+                                    <a target="_blank" rel="noreferrer" href="https://secure.syndetics.com/ffseries.aspx?isbn=[% normalized_isbn %]&amp;type=series&amp;num=1&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]">Click to open in new window</a>
                                 [% ELSE %]
-                                    <a target="_blank" href="http://www.syndetics.com/ffseries.aspx?isbn=[% normalized_isbn %]&amp;type=series&amp;num=1&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]">Click to open in new window</a>
+                                    <a target="_blank" rel="noreferrer" href="http://www.syndetics.com/ffseries.aspx?isbn=[% normalized_isbn %]&amp;type=series&amp;num=1&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]">Click to open in new window</a>
                                 [% END %]
                             </span>
                         [% END # / IF SyndeticsSeries && SyndeticsSERIES1Exists%]
                             <span class="results_summary">
                                 <span class="label">Audiovisual profile:</span>
                                 [% IF ( using_https ) %]
-                                    <a target="_blank" href="https://secure.syndetics.com/index.aspx?isbn=[% normalized_isbn %]/avprofile.html&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]&amp;type=xw10">Click to open in new window</a>
+                                    <a target="_blank" rel="noreferrer" href="https://secure.syndetics.com/index.aspx?isbn=[% normalized_isbn %]/avprofile.html&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]&amp;type=xw10">Click to open in new window</a>
                                 [% ELSE %]
-                                    <a target="_blank" href="http://www.syndetics.com/index.aspx?isbn=[% normalized_isbn %]/avprofile.html&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]&amp;type=xw10">Click to open in new window</a>
+                                    <a target="_blank" rel="noreferrer" href="http://www.syndetics.com/index.aspx?isbn=[% normalized_isbn %]/avprofile.html&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]&amp;type=xw10">Click to open in new window</a>
                                 [% END %]
                             </span>
                         [% END # / IF SyndeticsAVPROFILEExists %]
                             <span class="results_summary">
                             <span class="label">Fiction notes:</span>
                                 [% IF ( using_https ) %]
-                                    <a target="_blank" href="https://secure.syndetics.com/index.aspx?isbn=[% normalized_isbn %]/fiction.html&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]&amp;type=xw10">Click to open in new window</a>
+                                    <a target="_blank" rel="noreferrer" href="https://secure.syndetics.com/index.aspx?isbn=[% normalized_isbn %]/fiction.html&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]&amp;type=xw10">Click to open in new window</a>
                                 [% ELSE %]
-                                    <a target="_blank" href="http://www.syndetics.com/index.aspx?isbn=[% normalized_isbn %]/fiction.html&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]&amp;type=xw10">Click to open in new window</a>
+                                    <a target="_blank" rel="noreferrer" href="http://www.syndetics.com/index.aspx?isbn=[% normalized_isbn %]/fiction.html&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]&amp;type=xw10">Click to open in new window</a>
                                 [% END %]
                             </span>
                         [% END # / IF SyndeticsFICTIONExists %]
                             <span class="results_summary">
                                 <span class="label">Awards:</span>
                                 [% IF ( using_https ) %]
-                                    <a target="_blank" href="https://secure.syndetics.com/ffawards.aspx?isbn=[% normalized_isbn %]&amp;type=awards&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]">Click to open in new window</a>
+                                    <a target="_blank" rel="noreferrer" href="https://secure.syndetics.com/ffawards.aspx?isbn=[% normalized_isbn %]&amp;type=awards&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]">Click to open in new window</a>
                                 [% ELSE %]
-                                    <a target="_blank" href="http://www.syndetics.com/ffawards.aspx?isbn=[% normalized_isbn %]&amp;type=awards&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]">Click to open in new window</a>
+                                    <a target="_blank" rel="noreferrer" href="http://www.syndetics.com/ffawards.aspx?isbn=[% normalized_isbn %]&amp;type=awards&amp;client=[% SyndeticsClientCode %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc %][% END %]">Click to open in new window</a>
                                 [% END %]
                             </span>
                         [% END # / IF SyndeticsAwards && SyndeticsAWARDS1Exists %]
                         <form method="post" action="/cgi-bin/koha/opac-ratings.pl">
                             <div class="results_summary ratings">
 
+                                [% SET rating_avg = ratings.get_avg_rating() %]
+                                [% rating_avg_int = BLOCK %][% rating_avg | format("%.0f") %][% END %]
                                 [% FOREACH i  IN [ 1 2 3 4 5  ] %]
-                                    [% IF rating_avg == i && borrowernumber %]
+                                    [% IF rating_avg_int == i && borrowernumber %]
                                         <input class="auto-submit-star" type="radio" name="rating"  value="[% i %]"  checked="checked" />
-                                    [% ELSIF rating_avg == i %]
+                                    [% ELSIF rating_avg_int == i %]
                                         <input class="auto-submit-star" type="radio" name="rating" value="[% i %]" checked="checked" disabled="disabled" />
                                     [% ELSIF borrowernumber  %]
                                         <input class="auto-submit-star" type="radio" name="rating" value="[% i %]" />
 
                                 <!-- define some hidden vars for ratings -->
 
-                                <input  type="hidden" name='biblionumber'  value="[% biblionumber %]" />
-                                <input  type="hidden" name='rating_value' id='rating_value' value="[% rating_value %]" />
-                                <input  type="hidden" name='rating_total' id='rating_total' value="[% rating_total %]" />
-                                <input  type="hidden" name='rating_avg_int' id='rating_avg_int' value="[% rating_avg_int %]" />
+                                <input  type="hidden" name='biblionumber'  value="[% biblio.biblionumber %]" />
+                                <input  type="hidden" name='rating_value' id='rating_value' value="[% my_rating.rating_value %]" />
 
                                 [% UNLESS ( rating_readonly ) %]&nbsp;  <input name="rate_button" type="submit" value="Rate me" />[% END %]&nbsp;
 
-                                [% IF ( rating_value ) %]
-                                    <span id="rating_value_text">your rating: [% rating_value %], </span>
+                                [% IF my_rating %]
+                                    <span id="rating_value_text">your rating: [% my_rating.rating_value %], </span>
                                 [% ELSE %]
                                     <span id="rating_value_text"></span>
                                 [% END %]
 
-                                <span id="rating_text">average rating: [% rating_avg_int %] ([% rating_total %] votes)</span>
+                                <span id="rating_text">average rating: [% rating_avg %] ([% ratings.count %] votes)</span>
                             </div>
                         </form>
                     [% END # / IF OpacStarRatings != 'disable' %]
                     [% IF ( BakerTaylorContentURL ) %]
                         <span class="results_summary">
                         <span class="label">Enhanced content: </span>
-                              [% IF ( OPACURLOpenInNewWindow ) %]<a href="[% BakerTaylorContentURL |html %]" target="_blank">Content Cafe</a>[% ELSE %]<a href="[% BakerTaylorContentURL |html %]">Content Cafe</a>[% END %]
+                              [% IF ( OPACURLOpenInNewWindow ) %]<a href="[% BakerTaylorContentURL |html %]" target="_blank" rel="noreferrer">Content Cafe</a>[% ELSE %]<a href="[% BakerTaylorContentURL |html %]">Content Cafe</a>[% END %]
                         </span>
                     [% END # / IF BakerTaylorContentURL %]
 
                     [% IF ( NovelistSelectProfile && normalized_isbn ) %]
                         [% IF ( NovelistSelectView == 'above') %]
-                            <span class="results_summary">
+                            <span class="results_summary NovelistSelect" style="display:none;">
                             <span class="label">Novelist Select: </span>
                             <div data-novelist-novelistselect=[% normalized_isbn %]></div>
                             </span>
                 </div> <!-- / #catalogue_detail_biblio -->
 
                 <div id="bibliodescriptions" class="toptabs">
-
                     <ul>
                         [% IF ( defaulttab == 'holdings' ) %]
                             <li id="tab_holdings" class="ui-tabs-active">
                         [% ELSE %]
                             <li id="tab_holdings">
                         [% END %]
-                            <a href="#holdings">[% IF SeparateHoldings %][% LoginBranchname %] holdings[% ELSE %]Holdings[% END %] [% UNLESS too_many_items %] ( [% itemloop.size || 0 %] )[% END %]</a>
+                        [% BLOCK holding_tab_title %][% IF SeparateHoldings %]<span>[% LoginBranchname %] holdings</span>[% ELSE %]<span>Holdings</span>[% END %][% END %]
+                            <a href="#holdings">[% PROCESS holding_tab_title %] [% UNLESS too_many_items %][% ' ( ' _ (itemloop.size || 0) _ ' )' %][% END %]</a>
                         </li>
                         [% IF (SeparateHoldings) %]
-                            <li><a href="#otherholdings">Other holdings ( [% otheritemloop.size || 0 %] )</a></li>
+                            <li><a href="#otherholdings">Other holdings [% ' ( ' _ (otheritemloop.size || 0) _ ' )' %]</a></li>
                         [% END %]
                         [% IF ( MARCNOTES || notes || ( SyndeticsEnabled && SyndeticsSummary && SYNDETICS_SUMMARY )) %]
                             <li id="tab_descriptions"> <a href="#descriptions">Title notes</a></li>
                             [% IF ( SyndeticsExcerpt && SYNDETICS_EXCERPT ) %]
                                 <li id="tab_excerpt"> <a href="#excerpt">Excerpt</a></li>
                             [% END %]
-                            [% IF ( SyndeticsReviews && SYNDETICS_REVIEWS ) %]
+                            [% IF ( ( SyndeticsReviews && SYNDETICS_REVIEWS ) || ( LibraryThingForLibrariesTabbedView && LibraryThingForLibrariesID) ) %]
                                 <li id="tab_reviews"> <a href="#reviews">Reviews</a></li>
-                                <li id="tab_LTFLreviews">
-                                    [% IF ( using_https ) %]
+                                [% IF ( LibraryThingForLibrariesID ) %]
+                                    <li id="tab_LTFLreviews">
                                         <script src="https://www.librarything.com/forlibraries/widget.js?id=[% LibraryThingForLibrariesID %]" type="text/javascript"></script>
                                         <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 %]&amp;accessibility=1">here</a>.</noscript>
-                                    [% ELSE %]
-                                        <script src="http://www.librarything.com/forlibraries/widget.js?id=[% LibraryThingForLibrariesID %]" type="text/javascript"></script>
-                                        <noscript>This page contains enriched content visible when JavaScript is enabled or by clicking <a href="http://www.librarything.com/forlibraries/noscript.php?id=[% LibraryThingForLibrariesID %]&amp;accessibility=1">here</a>.</noscript>
-                                    [% END %]
-                                </li>
+                                    </li>
+                                [% END %]
                             [% END %]
                             [% IF ( SyndeticsAuthorNotes && SYNDETICS_ANOTES ) %]
                                 <li id="tab_anotes"> <a href="#anotes">About the author</a></li>
 
                         [% IF ( subscriptionsnumber ) %]
                             [% IF ( defaulttab == 'subscriptions' ) %]<li id="tab_subscriptions" class="ui-tabs-active">[% ELSE %]<li id="tab_subscriptions">[% END %]
-                                <a href="#subscriptions">Subscriptions</a>
+                                <a href="#subscriptions">Subscriptions ( [% subscriptionsnumber %] )</a>
                             </li>
                         [% END %]
 
                         [% IF Koha.Preference( 'reviewson' ) == 1 %]
-                            <li id="tab_comments"><a href="#comments">Comments ( [% reviews.size || 0 %] )</a></li>
+                            <li id="tab_comments"><a href="#comments">Comments[% ' ( ' _ (reviews.size || 0) _ ' )' %]</a></li>
                         [% END %]
 
                         [% IF ( NovelistSelectProfile && normalized_isbn ) %]
                             [% IF ( NovelistSelectView == 'tab') %]
-                                <li id="tab_NovelistSelect"> <a href="#NovelistSelect">Novelist Select</a></li>
+                                <li id="tab_NovelistSelect" class="NovelistSelect" style="display:none;"> <a href="#NovelistSelect">Novelist Select</a></li>
                             [% END %]
                         [% END %]
 
                         [% END %]
 
                         [% IF ( HTML5MediaEnabled && HTML5MediaSets ) %]
-                            <li id="tab_html5media"><a href="#html5media">Play media</a></li>
+                            [% IF ( defaulttab == 'media' ) %]<li id="tab_html5media" class="ui-tabs-active">[% ELSE %]<li id="tab_html5media">[% END %]<a href="#html5media">Play media</a></li>
                         [% END %]
 
                         [% IF ( IDreamBooksReviews ) %]
 
                     <div id="holdings">
                         [% IF too_many_items %]
-                            <p>This record has many physical items ([% items_count %]). <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]&amp;viewallitems=1">Click here to view them all.</a></p>
+                            <p>This record has many physical items ([% items_count %]). <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber %]&amp;viewallitems=1">Click here to view them all.</a></p>
                         [% ELSIF ( itemloop.size ) %]
-                            [% INCLUDE items_table items=itemloop tab="holdings" %]
-                            [% IF Koha.Preference('OPACAcquisitionDetails') and Koha.Preference('AcqCreateItem') != 'ordering' and acquisition_details.total_quantity > 0 %]
+                            [% INCLUDE items_table items=itemloop tab="holdings" table_id="holdingst" %]
+                            [% IF Koha.Preference('OPACAcquisitionDetails') and acquisition_details.total_quantity > 0 %]
                               [% IF acquisition_details.total_quantity == 1 %]
-                                1 item is on order.
+                                <span>1 item is on order.</span>
                               [% ELSE %]
-                                [% acquisition_details.total_quantity %] items are on order.
+                                <span>[% acquisition_details.total_quantity %] items are on order.</span>
                               [% END %]
                             [% END %]
                             [% IF holds_count.defined || priority %]
                                 <div id="bib_holds">
                                     [% IF holds_count.defined %]
-                                        Total holds: [% holds_count %]
+                                        <span>Total holds: [% holds_count %]</span>
                                     [% END %]
                                     [% IF priority %]
                                         [% IF holds_count.defined %]
-                                            (priority [% priority %])
+                                            <span>(priority [% priority %])</span>
                                         [% ELSE %]
-                                            Overall queue priority: [% priority %]
+                                            <span>Overall queue priority: [% priority %]</span>
                                         [% END %]
                                     [% END %]
                                 </div>
                                     <div id="alternateholdings"><span class="holdings_label">Holdings:</span> [% ALTERNATEHOLDING.holding %]</div>
                                 [% END %]
                             [% ELSE %]
-                                [% IF Koha.Preference('OPACAcquisitionDetails') and Koha.Preference('AcqCreateItem') != 'ordering' and acquisition_details.total_quantity > 0 %]
+                                [% IF Koha.Preference('OPACAcquisitionDetails') and acquisition_details.total_quantity > 0 %]
                                   [% IF acquisition_details.total_quantity == 1 %]
-                                    1 item is on order.
+                                    <span>1 item is on order.</span>
                                   [% ELSE %]
-                                    [% acquisition_details.total_quantity %] items are on order.
+                                    <span>[% acquisition_details.total_quantity %] items are on order.</span>
                                   [% END %]
                                 [% ELSE %]
                                     <div id="noitems">No physical items for this record</div>
                     [% IF (SeparateHoldings) %]
                         <div id="otherholdings">
                             [% IF (otheritemloop.size) %]
-                                [% INCLUDE items_table items=otheritemloop tab="otherholdings" %]
+                                [% INCLUDE items_table items=otheritemloop tab="otherholdings" table_id="otherholdingst" %]
                             [% ELSE %]
-                                No other items.
+                                <span>No other items.</span>
                             [% END %]
                             [% INCLUDE shelfbrowser tab='otherholdings' %]
                         </div>
                             [% IF ( MARCNOTES ) %]
                                 <div id="marcnotes">
                                 [% FOREACH MARCNOTE IN MARCNOTES %]
-                                    <p>[% MARCNOTE.marcnote FILTER html_line_break %]</p>
+                                    <p>
+                                    [% IF MARCNOTE.marcnote.match('^https?://\S+$') %]
+                                        <a href="[% MARCNOTE.marcnote %]">[% MARCNOTE.marcnote %]</a>
+                                    [% ELSE %]
+                                        [% MARCNOTE.marcnote FILTER html_line_break %]
+                                    [% END %]
+                                    </p>
                                 [% END %]
                                 </div>
                             [% ELSE %]
                         [% END # / IF SyndeticsReviews && SYNDETICS_REVIEWS %]
                     [% END # / IF SyndeticsEnabled %]
 
-                    [% IF ( NovelistSelectProfile && NovelistSelectView == 'tab' && normalized_isbn ) %]
-                       <div id="NovelistSelect">
-                            <div data-novelist-novelistselect=[% normalized_isbn %]></div>
+                    [% IF ( NovelistSelectProfile && NovelistSelectView == 'tab' && (normalized_isbn || normalized_upc) ) %]
+                       <div id="NovelistSelect" >
+                            <div data-novelist-novelistselect=[% IF normalized_isbn %][% normalized_isbn %][% ELSE %][% normalized_upc %][% END %]></div>
                        </div>
                     [% END # / IF NovelistSelectProfile && NovelistSelectView == 'tab' %]
 
                     [% IF ( subscriptionsnumber ) %]
                         <div id="subscriptions">
                             <h2>This is a serial</h2>
-                            <p>There are [% subscriptionsnumber %] subscription(s) associated with this title.</p>
+                            <p class="subscription_count">There are [% subscriptionsnumber %] subscription(s) associated with this title.</p>
                             [% FOREACH subscription IN subscriptions %]
-                                [% IF ( subscription.branchname ) %]
-                                    <h3>At library: [% subscription.branchname %]</h3>
+                                [% IF ( subscription.branchcode ) %]
+                                    <h3>At library: [% Branches.GetName( subscription.branchcode ) %]</h3>
                                 [% ELSE %]
                                     [% IF ( subscription.branchcode ) %]
                                         <h3>At library: [% subscription.branchcode %]</h3>
                                     [% END %]
                                 [% END %]
                                 [% IF ( subscription.closed ) %]
-                                    <p>This subscription is closed.</p>
+                                    <p class="subscription_closed">This subscription is closed.</p>
+                                [% END %]
+                                [% IF ( subscription.callnumber ) %]
+                                  <p class="subscription_callnumber">Call number: [% subscription.callnumber %]</p>
                                 [% END %]
-                                <span style="display:none;"> [% IF ( subscription.callnumber ) %]<p>Call number: [% subscription.callnumber %]</p>[% END %]</span>
                                 [% IF ( subscription.subscriptionnotes ) %]
-                                    <p>[% subscription.subscriptionnotes FILTER html_line_break %] </p>
+                                    <p class="subscription_notes">[% subscription.subscriptionnotes FILTER html_line_break %] </p>
                                 [% END %]
-                                <p>Subscription from: [% subscription.histstartdate | $KohaDates %] to:[% IF ( subscription.histenddate ) %] [% subscription.histenddate | $KohaDates %] [% ELSE %] now (current)[% END %]</p>
+                                <p class="subscription_dates">Subscription from: [% subscription.histstartdate | $KohaDates %] to:[% IF ( subscription.histenddate ) %] [% subscription.histenddate | $KohaDates %] [% ELSE %] now (current)[% END %]</p>
+                                [% IF ( subscription.letter ) %]<span class="email_notifications">
+                                    [% IF ( loggedinusername ) %]
+                                        [% IF ( subscription.hasalert ) %]
+                                            <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;externalid=[% subscription.subscriptionid %]&amp;biblionumber=[% subscription.biblionumber %]">Cancel email notification</a>
+                                        [% ELSE %]
+                                            <a style="color:#000;" class="btn" title="Subscribe to email notification on new issues" href="/cgi-bin/koha/opac-alert-subscribe.pl?externalid=[% subscription.subscriptionid %]&amp;biblionumber=[% subscription.biblionumber %]">Subscribe to email notification on new issues</a>
+                                        [% END %]
+                                    [% ELSE %]
+                                        <span>You must log in if you want to subscribe to email notification on new issues</span>
+                                    [% END %]
+                                </span>[% END %]
                                 [% IF ( subscription.missinglist ) %]
-                                    <p>Missing issues: [% subscription.missinglist %] </p>
+                                    <p class="subscription_missing">Missing issues: [% subscription.missinglist %] </p>
                                 [% END %]
                                 [% IF ( subscription.opacnote ) %]
-                                    <p>[% subscription.opacnote FILTER html_line_break %]</p>
-                                [% END %]
-                                [% IF ( subscription.callnumber ) %]
-                                  <p>Call number: [% subscription.callnumber %]</p>
+                                    <p class="subscription_opacnote">[% subscription.opacnote FILTER html_line_break %]</p>
                                 [% END %]
                                 [% IF ( subscription.latestserials ) %]
-                                    <p> The [% subscription.opacdisplaycount %] latest issues for this subscription:</p>
-                                    <table class="table table-bordered table-striped">
+                                    <p class="subscription_latestissues"> The [% subscription.opacdisplaycount %] latest issues for this subscription:</p>
+                                    <table class="table table-bordered table-striped" id="subscriptionst">
+                                        <thead>
                                         <tr>
-                                            <th>Issue #</th>
-                                            <th>Date</th>
-                                            <th>Status</th>
-                                            <th>Note</th>
+                                            <th id="serial_serialseq" data-colname="serial_serialseq">Issue #</th>
+                                            <th id="serial_publisheddate" data-colname="serial_publisheddate" class="title-string">Publication date</th>
+                                            <th id="serial_planneddate" data-colname="serial_planneddate" class="title-string">Received date</th>
+                                            <th id="serial_status" data-colname="serial_status">Status</th>
+                                            <th id="serial_notes" data-colname="serial_notes">Note</th>
                                         </tr>
+                                        </thead>
+                                        <tbody>
                                         [% FOREACH latestserial IN subscription.latestserials %]
                                             <tr>
-                                                <td>[% latestserial.serialseq %]</td>
-                                                <td>[% latestserial.planneddate %]</td>
-                                                <td>
-                                                    [% IF ( latestserial.status1 ) %]
-                                                        Awaited
-                                                    [% ELSE %]
-                                                        [% IF ( latestserial.status2 ) %]
-                                                            Arrived
-                                                        [% ELSE %]
-                                                            [% IF ( latestserial.status3 ) %]
-                                                                Late
-                                                            [% ELSE %]
-                                                                [% IF ( latestserial.status4 ) %]
-                                                                    Missing
-                                                                [% ELSE %]
-                                                                    [% IF ( latestserial.status5 ) %]
-                                                                        Not issued
-                                                                    [% END %]
-                                                                [% END %]
-                                                            [% END %]
-                                                        [% END %]
-                                                    [% END %]
+                                                <td class="serialseq">[% latestserial.serialseq %]</td>
+                                                <td class="publisheddate">[% latestserial.publisheddate %]</td>
+                                                <td class="planneddate">[% latestserial.planneddate %]</td>
+                                                <td class="serial_status">
+                                                    [% IF (latestserial.status1 ) %]<span>Expected</span>[% END %]
+                                                    [% IF (latestserial.status2 ) %]<span>Arrived</span>[% END %]
+                                                    [% IF (latestserial.status3 ) %]<span>Late</span>[% END %]
+                                                    [% IF (latestserial.status4 ) %]<span>Missing</span>[% END %]
+                                                        [% IF (latestserial.status41 ) %]<span>Missing (never received)</span>[% END %]
+                                                        [% IF (latestserial.status42 ) %]<span>Missing (sold out)</span>[% END %]
+                                                        [% IF (latestserial.status43 ) %]<span>Missing (damaged)</span>[% END %]
+                                                        [% IF (latestserial.status44 ) %]<span>Missing (lost)</span>[% END %]
+                                                    [% IF (latestserial.status5 ) %]<span>Not issued</span>[% END %]
+                                                    [% IF (latestserial.status6 ) %]<span>Delete</span>[% END %]
+                                                    [% IF (latestserial.status7 ) %]<span>Claimed</span>[% END %]
+                                                    [% IF (latestserial.status8 ) %]<span>Stopped</span>[% END %]
                                                 </td>
-                                                <td>[% latestserial.notes %]</td>
+                                                <td class="serial_notes">[% latestserial.notes %]</td>
                                             </tr>
                                         [% END # / FOREACH latestserials %]
+                                        </tbody>
                                     </table>
                                 [% END # / IF subscription.latestserials %]
                             [% END # / FOREACH subscriptions %]
-                            <p><a href="opac-serial-issues.pl?biblionumber=[% biblionumber %]">More details</a></p>
+                            <p class="subscription_moredetails"><a href="opac-serial-issues.pl?biblionumber=[% biblio.biblionumber %]">More details</a></p>
                         </div> <!-- / #subscriptions -->
                     [% END # IF subscriptionsnumber %]
 
                             <div id="newcomment"></div>
                                 [% IF ( reviews ) %]
                                     [% FOREACH review IN reviews %]
-                                        [% IF ( review.your_comment ) %]
+                                        [% IF borrowernumber && review.borrowernumber == borrowernumber %]
                                             <div class="commentline yours" id="c[% review.reviewid %]">
                                                 [% IF ( review.avatarurl ) %]
                                                     <img class="avatar" src="[% review.avatarurl %]" height="80" width="80" alt="" />
                                                 [% END %]
-                                                <h5>Your comment</h5>
+                                                [% IF review.approved %]
+                                                    <h5>Your comment</h5>
+                                                [% ELSE %]
+                                                    <h5>Your comment (preview, pending approval)</h5>
+                                                [% END %]
                                                 <small>[% review.datereviewed | $KohaDates %]</small>
                                                 <p>
                                                     [% FILTER html_break %]
                                             </div>
                                         [% ELSE %]
                                             <div class="commentline">
-                                                [% IF ( ShowReviewer != "none" ) %]
+                                                [% IF ( ShowReviewer != "none" && review.patron) %]
+
                                                     [% IF ( review.avatarurl ) %]
                                                         <img class="avatar" src="[% review.avatarurl %]" height="80" width="80" alt="" />
                                                     [% END %]
                                                     [% SWITCH ShowReviewer %]
                                                     [% CASE 'full' %]
-                                                        <h5>Comment by [% review.title %] [% review.firstname %] [% review.surname %]</h5>
+                                                        <h5>Comment by [% review.patron.title %] [% review.patron.firstname %] [% review.patron.surname %]</h5>
                                                     [% CASE 'first' %]
-                                                        <h5>Comment by [% review.firstname %]</h5>
+                                                        <h5>Comment by [% review.patron.firstname %]</h5>
                                                     [% CASE 'surname' %]
-                                                        <h5>Comment by [% review.surname %]</h5>
+                                                        <h5>Comment by [% review.patron.surname %]</h5>
                                                     [% CASE 'firstandinitial' %]
-                                                        <h5>Comment by [% review.firstname %] [% review.surname|truncate(2,'.') %]</h5>
+                                                        <h5>Comment by [% review.patron.firstname %] [% review.patron.surname|truncate(2,'.') %]</h5>
                                                     [% CASE 'username' %]
-                                                        <h5>Comment by [% review.userid %]</h5>
+                                                        <h5>Comment by [% review.patron.userid %]</h5>
                                                     [% END %]
+
                                                     <small>[% review.datereviewed | $KohaDates %]</small>
-                                                [% ELSIF ( ShowReviewer == "none") %]
+                                                [% ELSE %]
                                                     <h5>Patron comment on [% review.datereviewed | $KohaDates %]</h5>
-                                                [% END # / IF ShowReviewer != "none"%]
+                                                [% END # / IF ShowReviewer != "none" && review.patron %]
                                                 <p>
                                                   [% FILTER html_break %]
                                                   [% review.review |html %]
                                                   [% END %]
                                                 </p>
                                             </div> <!-- / .commentline -->
-                                        [% END # / IF review.your_comment %]
+                                        [% END %]
                                     [% END # / FOREACH reviews %]
                                 [% ELSE %]
                                     <p>There are no comments for this item.</p>
 
                                 [% IF ( loggedinusername ) %]
                                     [% UNLESS ( loggedincommenter ) %]
-                                       <div id="addcomment"> <a href="#" onclick="Dopop('/cgi-bin/koha/opac-review.pl?biblionumber=[% biblionumber %]'); return false;">
-                                            Post or edit your comments on this item.
+                                       <div id="addcomment"> <a href="#" onclick="Dopop('/cgi-bin/koha/opac-review.pl?biblionumber=[% biblio.biblionumber %]'); return false;">
+                                            Post your comments on this item.
                                         </a></div>
                                     [% END %]
                                 [% ELSE %]
                                                 <td>[% XISBN.description %]</td>
                                             [% END %]
                                             <td><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% XISBN.biblionumber %]">[% XISBN.title |html %]</a>
-                                                [% IF ( XISBN.author ) %] by [% XISBN.author |html %][% END %]
-                                                [% IF ( XISBN.copyrightdate ) %] &copy;[% XISBN.copyrightdate %][% END %]
+                                                [% IF ( XISBN.author ) %]<span> by </span>[% XISBN.author |html %][% END %]
+                                                [% IF ( XISBN.copyrightdate ) %]<span> &copy;</span>[% XISBN.copyrightdate %][% END %]
                                                 [% IF ( XISBN.publishercode ) %]
                                                     <p>[% XISBN.publishercode |html %]
                                                         [% IF ( XISBN.place ) %]([% XISBN.place %])[% END %]
-                                                        [% IF ( XISBN.publicationyear ) %], [% XISBN.publicationyear %][% END %]
+                                                        [% IF ( XISBN.publicationyear ) %][% ', ' _ XISBN.publicationyear %][% END %]
                                                         [% IF ( XISBN.pages ) %][% XISBN.pages %] [% XISBN.illus %] [% XISBN.size %][% END %]
                                                     </p>
                                                 [% END %]
 
                         [% IF ( HTML5MediaEnabled ) %]
                             <div id="html5media">
-                                    <p>
-                                        <[% HTML5MediaParent %] controls preload=none>
-                                          [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
-                                            <[% HTML5MediaSet.child  %] src="[% HTML5MediaSet.srcblock %]"[% HTML5MediaSet.typeblock %] />
-                                          [% END %]
-                                            [[% HTML5MediaParent %] tag not supported by your browser.]
-                                        </[% HTML5MediaParent %]>
-                                    </p>
+                              [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
+                                <p>
+                                  [% SET ctrl_preload = ' controls preload=none' #translatability %]
+                                  <[% HTML5MediaParent _ ctrl_preload %] >
+                                    <[% HTML5MediaSet.child _ ' src="' _  HTML5MediaSet.srcblock _'"' _ HTML5MediaSet.typeblock %] />
+                                    <span>[[% HTML5MediaParent %] tag not supported by your browser.]</span>
+                                  </[% HTML5MediaParent %]>
+                                </p>
+                              [% END %]
                             </div>
                         [% END # / IF HTML5MediaEnabled %]
 
                                 <p>Click on an image to view it in the image viewer</p>
                                 [% FOREACH image IN localimages %]
                                     [% IF image %]
-                                        <a class="localimage" href="/cgi-bin/koha/opac-imageviewer.pl?biblionumber=[% biblionumber %]&amp;imagenumber=[% image %]"><img alt="" src="/cgi-bin/koha/opac-image.pl?thumbnail=1&amp;imagenumber=[% image %]" /></a>
+                                        <a class="localimage" href="/cgi-bin/koha/opac-imageviewer.pl?biblionumber=[% biblio.biblionumber %]&amp;imagenumber=[% image %]"><img alt="" src="/cgi-bin/koha/opac-image.pl?thumbnail=1&amp;imagenumber=[% image %]" /></a>
                                     [% END %]
                                 [% END %]
                             </div><!-- / #images -->
                         [% END %]
                 </div> <!-- / #bibliodescriptions -->
 
-                [% IF ( NovelistSelectProfile && NovelistSelectView == 'below' && normalized_isbn ) %]
+                [% IF ( NovelistSelectProfile && NovelistSelectView == 'below' && ( normalized_isbn || normalized_upc ) ) %]
                     <div id="NovelistSelect">
                         <h3>Novelist Select</h3>
-                        <div data-novelist-novelistselect="[% normalized_isbn %]"></div>
+                        <div data-novelist-novelistselect="[% IF normalized_isbn %][% normalized_isbn %][% ELSE %][% normalized_upc %][% END %]"></div>
                     </div>
                 [% END %]
 
                     </div>
                 [% END # / IF Babeltheque %]
 
-            [% INCLUDE "openlibrary-readapi.inc" bib = {
-                normalized_isbn => normalized_isbn,
-                lccn => lccn,
-                normalized_oclc => normalized_oclc
-            } %]
+            [%# Following on one line due to translation issues %]
+            [% INCLUDE "openlibrary-readapi.inc" bib = { normalized_isbn => normalized_isbn,lccn => lccn, normalized_oclc => normalized_oclc } %]
 
         </div> <!-- /.span9 -->
 
                     <div class="nav_results">
                         <div class="l_Results">
                             [% IF ( listResults ) %]
-                                <a href="#" id="a_listResults" title="Show pagination list ([% indexPag %]-[% indexPagEnd %] / [% totalPag %])">Browse results</a>
+                                <a href="#" id="a_listResults">Browse results</a>
                             [% ELSE %]
                                 <span>Browse results</span>
                             [% END %]
 
                 [% INCLUDE 'opac-detail-sidebar.inc' %]
 
-                [% IF ( NovelistSelectProfile && NovelistSelectView == 'right' && normalized_isbn ) %]
+                [% IF ( NovelistSelectProfile && NovelistSelectView == 'right' && ( normalized_isbn || normalized_upc ) ) %]
                     <div id="NovelistSelect">
                         <h4>Novelist Select</h4>
-                        <div data-novelist-novelistselect=[% normalized_isbn %]></div>
+                        <div data-novelist-novelistselect=[% IF normalized_isbn %][% normalized_isbn %][% ELSE %][% normalized_upc %][% END %]></div>
                     </div>
                 [% END %]
 
                         <span>Share</span>
                         <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>
                         <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>
-                        <div><a id="delicious" href="http://www.delicious.com/save?url=[% current_url |url %]&amp;title=[% title |url %]" title="Share on Delicious">Delicious</a></div>
                         <div><a id="email" href="mailto:?subject=[% title |url %]&amp;body=[% title |url %]%20([% current_url |url %])" title="Share by email">Email</a></div>
                         <div><div class="g-plusone" data-size="small" data-count="false"></div></div>
                         <div><a id="twitter" href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-text="[% title |url %]" data-lang="[% lang %]">Tweet</a></div>
     </div> <!-- / .row-fluid -->
     <div class="row-fluid">
         [% IF ( LibraryThingForLibrariesID ) %]
-            [% IF ( using_https ) %]
-                <script src="https://ltfl.librarything.com/forlibraries/widget.js?systype=koha&amp;id=[% LibraryThingForLibrariesID %]" type="text/javascript"></script>
-                <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 %]&amp;accessibility=1">here</a>.</noscript>
-            [% ELSE %]
-                <script src="http://ltfl.librarything.com/forlibraries/widget.js?systype=koha&amp;id=[% LibraryThingForLibrariesID %]" type="text/javascript"></script>
-                <noscript>This page contains enriched content visible when JavaScript is enabled or by clicking
-                <a href="http://www.librarything.com/forlibraries/noscript.php?id=
-                [% LibraryThingForLibrariesID %]&amp;accessibility=1">here</a>.</noscript>
-            [% END %]
+            <script src="https://ltfl.librarything.com/forlibraries/widget.js?systype=koha&amp;id=[% LibraryThingForLibrariesID %]" type="text/javascript"></script>
+            <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 %]&amp;accessibility=1">here</a>.</noscript>
         [% END %]
 
         [% IF ( NovelistSelectProfile && normalized_isbn ) %]
 [%# End of template %]
 
 [% BLOCK items_table %]
-    <table class="holdingst table table-bordered table-striped">
+    <table class="table table-bordered table-striped" id="[% table_id %]">
         <thead>
             <tr>
-                [% IF ( item_level_itypes ) %]<th id="item_itemtype" class="itype">Item type</th>[% END %]
-                [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' || singleBranchMode ) %]
-                    <th id="item_current_location" class="item_location">Current location</th>
-                [% END %]
-                [% UNLESS ( singleBranchMode ) %]
-                    [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %]
-                        <th id="item_home_location" class="item_location">Home library</th>
-                    [% END %]
-                [% END %]
-                [% IF ( itemdata_ccode ) %]<th id="item_ccode" class="collection">Collection</th>[% END %]
-                <th id="item_callnumber" class="call_no">Call number</th>
-                [% IF ( itemdata_enumchron ) %]<th id="item_enumchron" class="vol_info">Vol info</th>[% END %]
-                [% IF ( itemdata_uri ) %]<th id="item_url" class="url">url</th>[% END %]
-                [% IF ( itemdata_copynumber ) %]<th id="item_copy" class="copynumber">Copy number</th>[% END %]
-                <th id="item_status" class="status">Status</th>
-                [% IF ( itemdata_itemnotes ) %]<th id="item_notes" class="notes">Notes</th>[% END %]
-                <th id="item_datedue" class="date_due">Date due</th>
-                [% IF ( OPACShowBarcode ) %]<th id="item_barcode" class="barcode">Barcode</th>[% END %]
-                [% IF holds_count.defined %]
-                    <th id="item_holds">Item holds</th>
-                [% ELSIF show_priority %]
-                    <th id="item_priority">Item hold queue priority</th>
-                [% END %]
-                [% IF ( ShowCourseReservesHeader ) %]<th id="item_coursereserves">Course reserves</th>[% END %]
+        [% IF ( item_level_itypes ) %]
+                <th id="item_itemtype" data-colname="item_itemtype" class="itype">Item type</th>[% END %]
+        [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %]
+                <th id="item_current_location" data-colname="item_current_location" class="item_location">Current location</th>[% END %]
+        [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %]
+                <th id="item_home_location" data-colname="item_home_location" class="item_location">Home library</th>[% END %]
+        [% IF ( itemdata_ccode ) %]
+                <th id="item_ccode" data-colname="item_ccode" class="collection">Collection</th>[% END %]
+        [% IF ( Koha.Preference('OpacLocationOnDetail') == 'column' && itemdata_location ) %]
+                <th id="item_shelving_location" data-colname="item_shelving_location" class="shelving_location">Shelving location</th>[% END %]
+                <th id="item_callnumber" data-colname="item_callnumber" class="call_no">Call number</th>
+        [% IF ( itemdata_enumchron ) %]
+                <th id="item_enumchron" data-colname="item_enumchron" class="vol_info">Vol info</th>[% END %]
+        [% IF ( itemdata_uri ) %]
+                <th id="item_url" data-colname="item_url" class="url">URL</th>[% END %]
+        [% IF ( itemdata_copynumber ) %]
+                <th id="item_copy" data-colname="item_copy" class="copynumber">Copy number</th>[% END %]
+                <th id="item_status" data-colname="item_status" class="status">Status</th>
+        [% IF ( itemdata_itemnotes ) %]
+                <th id="item_notes" data-colname="item_notes" class="notes">Notes</th>[% END %]
+                <th id="item_datedue" data-colname="item_datedue" class="date_due">Date due</th>
+                <th id="item_barcode" data-colname="item_barcode" class="barcode">Barcode</th>
+        [% IF holds_count.defined %]
+                <th id="item_holds" data-colname="item_holds">Item holds</th>
+        [% ELSIF show_priority %]
+                <th id="item_priority" data-colname="item_priority">Item hold queue priority</th>
+        [% END %]
+        [% IF ( ShowCourseReservesHeader ) %]
+                <th id="item_coursereserves" data-colname="item_coursereserves">Course reserves</th>[% END %]
             </tr>
         </thead>
         <tbody>
                             [% ITEM_RESULT.description %]
                         </td>
                     [% END %]
-                    [% UNLESS singleBranchMode %]
-                        [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %]
-                            <td class="location" property="seller">
-                                <link property="itemOffered" href="#record" />
-                                <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut">
-                                <span class="[% ITEM_RESULT.holding_branch_opac_info ? 'branch-info-tooltip-trigger' : '' %]" title="">
-                                    [% IF ( ITEM_RESULT.branchurl ) %]
-                                        <a href="[% ITEM_RESULT.branchurl %]">[% ITEM_RESULT.branchname %]</a>
-                                    [% ELSE %]
-                                        <span>[% ITEM_RESULT.branchname %]</span>
-                                    [% END %]
-                                </span>
-                                <div class="branch-info-tooltip">[% ITEM_RESULT.holding_branch_opac_info %]</div>
-
-                                [% IF ( OpacLocationBranchToDisplayShelving == 'holding' || OpacLocationBranchToDisplayShelving == 'both' ) %]
-                                    <span class="shelvingloc">[% ITEM_RESULT.location_description %]</span>
+                    [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %]
+                        <td class="location" property="seller">
+                            <link property="itemOffered" href="#record" />
+                            <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut">
+                            <span class="[% ITEM_RESULT.holding_branch_opac_info ? 'branch-info-tooltip-trigger' : '' %]" title="">
+                                [% IF ( ITEM_RESULT.branchurl ) %]
+                                    <a href="[% ITEM_RESULT.branchurl %]">[% ITEM_RESULT.branchname %]</a>
+                                [% ELSE %]
+                                    <span>[% ITEM_RESULT.branchname %]</span>
                                 [% END %]
+                            </span>
+                            <div class="branch-info-tooltip">[% ITEM_RESULT.holding_branch_opac_info %]</div>
 
-                            </td>
-                        [% END %]
+                            [% IF ( Koha.Preference('OpacLocationOnDetail') == 'holding' || Koha.Preference('OpacLocationOnDetail') == 'both' ) %]
+                                <span class="shelvingloc">[% ITEM_RESULT.location_description %]</span>
+                            [% END %]
 
-                        [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %]
-                            <td class="location" property="seller">
-                                <link property="itemOffered" href="#record" />
-                                <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut">
-                                <span class="[% ITEM_RESULT.home_branch_opac_info ? 'branch-info-tooltip-trigger' : '' %]" title="">
-                                    [% IF Branches.GetURL( ITEM_RESULT.homebranch ) %]
-                                        [% home_branch_url = Branches.GetURL( ITEM_RESULT.homebranch ) %]
-                                        [% IF ( home_branch_url ) %]
-                                             <a href="[% home_branch_url %]">[% Branches.GetName( ITEM_RESULT.homebranch ) %]</a>
-                                        [% ELSE %]
-                                            <span>[% Branches.GetName( ITEM_RESULT.homebranch ) %]</span>
-                                        [% END %]
+                        </td>
+                    [% END %]
+
+                    [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %]
+                        <td class="location" property="seller">
+                            <link property="itemOffered" href="#record" />
+                            <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut">
+                            <span class="[% ITEM_RESULT.home_branch_opac_info ? 'branch-info-tooltip-trigger' : '' %]" title="">
+                                [% IF Branches.GetURL( ITEM_RESULT.homebranch ) %]
+                                    [% home_branch_url = Branches.GetURL( ITEM_RESULT.homebranch ) %]
+                                    [% IF ( home_branch_url ) %]
+                                         <a href="[% home_branch_url %]">[% Branches.GetName( ITEM_RESULT.homebranch ) %]</a>
                                     [% ELSE %]
                                         <span>[% Branches.GetName( ITEM_RESULT.homebranch ) %]</span>
                                     [% END %]
-                                </span>
-                                <div class="branch-info-tooltip">[% ITEM_RESULT.home_branch_opac_info %]</div>
-
-                                [% IF ( OpacLocationBranchToDisplayShelving == 'home' || OpacLocationBranchToDisplayShelving == 'both' ) %]
-                                    <span class="shelvingloc">[% ITEM_RESULT.location_description %]</span>
+                                [% ELSE %]
+                                    <span>[% Branches.GetName( ITEM_RESULT.homebranch ) %]</span>
                                 [% END %]
+                            </span>
+                            <div class="branch-info-tooltip">[% ITEM_RESULT.home_branch_opac_info %]</div>
 
-                            </td>
-                        [% END %]
+                            [% IF ( Koha.Preference('OpacLocationOnDetail') == 'home' || Koha.Preference('OpacLocationOnDetail') == 'both' ) %]
+                                <span class="shelvingloc">[% ITEM_RESULT.location_description %]</span>
+                            [% END %]
 
-                    [% ELSE %]
-                         <td class="location"><span class="shelvingloc">[% ITEM_RESULT.location_description %]</span></td>
+                        </td>
                     [% END %]
 
                     [% IF ( itemdata_ccode ) %]
                         <td class="collection">[% ITEM_RESULT.ccode %]</td>
                     [% END %]
+
+                    [% IF ( Koha.Preference('OpacLocationOnDetail') == 'column' && itemdata_location ) %]
+                        <td class="shelving_location">[% ITEM_RESULT.location_description %]</td>
+                    [% END %]
+
                     <td class="call_no" property="sku">
                         [% IF ( ITEM_RESULT.itemcallnumber ) %]
                             [% ITEM_RESULT.itemcallnumber %]
                         [% END %]
                     </td>
                     [% IF ( itemdata_enumchron ) %]
-                        <td class="vol_info">[% ITEM_RESULT.enumchron %]</td>
+                        <td class="vol_info">
+                            [% IF ITEM_RESULT.enumchron && ITEM_RESULT.serialseq %]
+                                <span class="enum">[% ITEM_RESULT.enumchron %]</span>
+                                [% IF ( ITEM_RESULT.serialseq && ITEM_RESULT.enumchron!=ITEM_RESULT.serialseq ) %]
+                                    <span class="sep"> -- </span>
+                                    <span class="serialseq">[% ITEM_RESULT.serialseq | html %]</span>
+                                [% END %]
+                            [% ELSIF ITEM_RESULT.enumchron %]
+                                <span class="enum">[% ITEM_RESULT.enumchron | html %]</span>
+                            [% ELSIF ITEM_RESULT.serialseq %]
+                                    <span class="serialseq">[% ITEM_RESULT.serialseq | html %]</span>
+                            [% END %]
+                            [% IF ( ITEM_RESULT.publisheddate ) %]
+                                <span class="pubdate">([% ITEM_RESULT.publisheddate | $KohaDates %])</span>
+                            [% END %]
+                        </td>
                     [% END %]
                     [% IF ( itemdata_uri ) %]
                         <td class="url">
                             [% IF ITEM_RESULT.uri %]
                                 [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
                                     [% IF Koha.Preference("OPACURLOpenInNewWindow") %]
-                                    <a target="_blank" href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | url %]&amp;biblionumber=[% biblionumber |url %]&amp;itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url"> Link to resource </a>
+                                    <a target="_blank" rel="noreferrer" href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | uri %]&amp;biblionumber=[% biblio.biblionumber %]&amp;itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url"> Link to resource </a>
                                     [% ELSE %]
-                                    <a href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | url %]&amp;biblionumber=[% biblionumber |url %]&amp;itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url"> Link to resource </a>
+                                    <a href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | uri %]&amp;biblionumber=[% biblio.biblionumber %]&amp;itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url"> Link to resource </a>
                                     [% END %]
+
                                 [% ELSE %]
                                     [% IF Koha.Preference("OPACURLOpenInNewWindow") %]
-                                    <a target="_blank" href="[% ITEM_RESULT.uri %]" property="url">[% ITEM_RESULT.uri %]</a>
+                                    <a target="_blank" rel="noreferrer" href="[% ITEM_RESULT.uri %]" property="url">[% ITEM_RESULT.uri %]</a>
                                     [% ELSE %]
                                     <a href="[% ITEM_RESULT.uri %]" property="url">[% ITEM_RESULT.uri %]</a>
                                     [% END %]
                     <td class="status">[% INCLUDE 'item-status-schema-org.inc' item = ITEM_RESULT %][% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td>
                     [% IF ( itemdata_itemnotes ) %]<td class="notes" property="description">[% ITEM_RESULT.itemnotes %]</td>[% END %]
                     <td class="date_due"><span title="[% ITEM_RESULT.datedue %]">[% ITEM_RESULT.datedue | $KohaDates as_due_date => 1 %]</span></td>
-                    [% IF ( OPACShowBarcode ) %]<td class="barcode" property="serialNumber">[% ITEM_RESULT.barcode %]</td>[% END %]
+                        <td class="barcode" property="serialNumber">[% ITEM_RESULT.barcode %]</td>
                     [% IF holds_count.defined || show_priority %]
                         <td class="holds_count">
                             [% IF holds_count.defined %] [% ITEM_RESULT.holds_count %] [% END %]
                             [% IF ITEM_RESULT.priority %]
                                 [% IF holds_count.defined %]
-                                    (priority [% ITEM_RESULT.priority %])
+                                    <span>(priority [% ITEM_RESULT.priority %])</span>
                                 [% ELSE %]
-                                    [% ITEM_RESULT.priority %]
+                                    <span>[% ITEM_RESULT.priority %]</span>
                                 [% END %]
                             [% END %]
                         </td>
 
 [% BLOCK jsinclude %]
 [% INCLUDE 'datatables.inc' %]
+[% INCLUDE 'columns_settings.inc' %]
 [% IF ( SocialNetworks ) %]
     <script type="text/javascript" src="https://apis.google.com/js/plusone.js">
     //<![CDATA[
     </script>
     <script type="text/javascript">!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>
 [% END %]
-[% IF ( OpacStarRatings != 'disable' ) %]<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.rating.js"></script>[% END %]
+[% IF ( OpacStarRatings != 'disable' ) %][% Asset.js("lib/jquery/plugins/jquery.rating.js") %][% END %]
 
-[% IF ( OpacHighlightedWords ) %]<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.highlight-3.js"></script>[% END %]
+[% IF ( OpacHighlightedWords ) %][% Asset.js("lib/jquery/plugins/jquery.highlight-3.js") %][% END %]
 
 <script type="text/javascript">
 //<![CDATA[
                 return element.html();
             }
         });
+
+        var columns_settings = [% ColumnsSettings.GetColumns( 'opac', 'biblio-detail', 'holdingst', 'json' ) %];
+
+        KohaTable("#holdingst", {
+            dom: 'B<"clearfix">t',
+            "columnDefs": [
+                { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
+                { "sType": "title-string", "aTargets" : [ "title-string" ] }
+                ],
+            "bKohaColumnsUseNames": true
+        }, columns_settings);
+
+        KohaTable("#otherholdingst", {
+            dom: 'B<"clearfix">t',
+            "columnDefs": [
+                { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
+                { "sType": "title-string", "aTargets" : [ "title-string" ] }
+                ],
+            "bKohaColumnsUseNames": true
+        }, columns_settings);
+
+        var serial_column_settings = [% ColumnsSettings.GetColumns( 'opac', 'biblio-detail', 'subscriptionst', 'json' ) %];
+
+        KohaTable("#subscriptionst", {
+            dom: 'B<"clearfix">t',
+            "columnDefs": [
+                { "sType": "title-string", "aTargets" : [ "title-string" ] }
+                ],
+            "bKohaColumnsUseNames": true
+        }, serial_column_settings);
+
 [% IF ( TagsInputEnabled && loggedinusername ) %]
         $(".tag_add").click(function(){
             var thisid = $(this).attr("id");
         });
 [% END %]
 
-        $(".holdingst").dataTable($.extend(true, {}, dataTablesDefaults, {
-            "aoColumns": [
-                [% IF ( item_level_itypes ) %]null,[% END %]
-                null,
-                [% IF ( OpacLocationBranchToDisplay == 'both' ) %]null,[% END %]
-                [% IF ( itemdata_ccode ) %]null,[% END %]
-                null,
-                [% IF ( itemdata_enumchron ) %]null,[% END %]
-                [% IF ( itemdata_uri ) %]null,[% END %]
-                [% IF ( itemdata_copynumber ) %]null,[% END %]
-                null,
-                [% IF ( itemdata_itemnotes ) %]null,[% END %]
-                { "sType": "title-string" },
-                [% IF ( OPACShowBarcode ) %]null,[% END %]
-                [% IF holds_count.defined %]
-                    null,
-                [% ELSIF show_priority %]
-                    null,
-                [% END %]
-                [% IF ( ShowCourseReservesHeader ) %]null,[% END %]
-            ]
-        }));
+        [%# Note that there is no way atm to target a column with its class name to set it as the default sort order %]
+        [% IF Koha.Preference('OpacLocationBranchToDisplay') == 'home' AND Koha.Preference('OPACHoldingsDefaultSortField') == 'homebranch' AND item_level_itypes
+        OR Koha.Preference('OpacLocationBranchToDisplay') == 'holding' AND Koha.Preference('OPACHoldingsDefaultSortField') == 'holdingbranch' AND item_level_itypes
+        OR Koha.Preference('OpacLocationBranchToDisplay') == 'both' AND Koha.Preference('OPACHoldingsDefaultSortField') == 'homebranch' AND NOT item_level_itypes
+        OR Koha.Preference('OpacLocationBranchToDisplay') == 'both' AND Koha.Preference('OPACHoldingsDefaultSortField') == 'holdingbranch' AND item_level_itypes %]
+            var default_order_index = 1;
+        [% ELSIF Koha.Preference('OpacLocationBranchToDisplay') == 'both' AND Koha.Preference('OPACHoldingsDefaultSortField') == 'homebranch' AND item_level_itypes %]
+            var default_order_index = 2;
+        [% ELSE %]
+            var default_order_index = 0;
+        [% END %]
 
         [% IF ( query_desc ) %][% IF ( OpacHighlightedWords ) %]var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') |html %]";
             q_array = query_desc.split(" ");
     [% IF OPACLocalCoverImages %]
         KOHA.LocalCover.GetCoverFromBibnumber(true);
     [% END %]
-    [% IF ( NovelistSelectProfile && normalized_isbn ) %]
-        novSelect.loadContentForISBN('[% normalized_isbn %]','[% NovelistSelectProfile %]', '[% NovelistSelectPassword %]', function(d){});
+    [% IF ( NovelistSelectProfile && ( normalized_isbn || normalized_upc ) ) %]
+        novSelect.loadContentForQuery(
+            {
+                ClientIdentifier : '[% IF normalized_isbn %][% normalized_isbn %][% ELSE %][% normalized_upc %][% END %]',
+                ISBN : '[% IF normalized_isbn %][% normalized_isbn %][% ELSE %][% normalized_upc %][% END %]',
+                version : '2.1'
+            },
+            '[% NovelistSelectProfile %]',
+            '[% NovelistSelectPassword %]',
+            function(d){
+                if ( d.length > 0 ){ //If no content
+                    $(".NovelistSelect").show();
+                }
+            });
     [% END %]
 
     [% IF ( OpacBrowseResults && busc ) %]
+        var list_title_showmsg = _("Show pagination list (%s-%s / %s)").format([% indexPag %], [% indexPagEnd %], [% totalPag %]);
+        var list_title_hidemsg = _("Hide pagination list (%s-%s / %s)").format([% indexPag %], [% indexPagEnd %], [% totalPag %]);
         if (arrPagination.length > 0) {
             renderPagIndexList(pag_index_ini, $("#listResults"));
+            var reslist = $("#a_listResults");
+            reslist.attr('title', list_title_showmsg);
         }
         $("#a_listResults").click(function(e) {
             if (arrPagination.length > 0) {
                 var navigation = $(".results-pagination");
                 if (navigation.css("display") == 'none') {
                     navigation.show();
-                    var newtitle = $(this).attr('title').replace('Show', 'Hide')
-                    $(this).attr('title',newtitle);
+                    $(this).attr('title',list_title_hidemsg);
                     renderPagination(pag_index_ini, arrPagination.length - 1, $("#ul_pagination_list"), false);
                 } else {
                     navigation.hide();
-                    var newtitle = $(this).attr('title').replace('Hide', 'Show')
-                    $(this).attr('title',newtitle);
+                    $(this).attr('title',list_title_showmsg);
                 }
             }
         });
 
     $(function () {
       $(".auto-submit-star").rating({
+        cancel: _("Cancel rating"),
         callback: function (value, link) {
 
           // if the new value equals the old value, dont execute callback...
               $.post("/cgi-bin/koha/opac-ratings-ajax.pl", {
                 rating_old_value: $("#rating_value").attr("value"),
                 borrowernumber: "[% borrowernumber %]",
-                biblionumber: "[% biblionumber %]",
+                biblionumber: "[% biblio.biblionumber %]",
                 rating_value: value,
                 auth_error: value
               }, function (data) {
                   $("#rating_value").val(data.rating_value);
 
                   if (data.rating_value) {
-                    $("#rating_value_text").text(_("your rating: ") + data.rating_value + ", ");
+                    $("#rating_value_text").text(_("your rating: %s, ").format(data.rating_value));
                   } else {
                     $("#rating_value_text").text('');
                   }
 
-                  $("#rating_text").text(_("average rating: ") + data.rating_avg_int + " (" + data.rating_total + ' ' + _("votes") + ")");
+                  $("#rating_text").text(_("average rating: %s (%s votes)").format(data.rating_avg, data.rating_total));
 
                 }
               }, "json");