Bug 15685: Allow creation of items (AcqCreateItem) to be customizable per-basket
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-detail.tt
index 28a3686..f450d0e 100644 (file)
@@ -1,9 +1,15 @@
+[% USE Math %]
 [% USE Koha %]
 [% USE KohaDates %]
 [% USE Branches %]
 [% 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 %]
@@ -23,7 +29,8 @@
 [% ELSE %]
     [% SET protocol = "http://" %]
 [% END %]
-[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Details for: [% title |html %][% FOREACH subtitl IN subtitle %], [% subtitl.subfield |html %][% END %]
+[% INCLUDE 'doc-head-open.inc' %]
+<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 %]
@@ -31,6 +38,7 @@
 [% IF ( OpacStarRatings != 'disable' ) %]
     [% BLOCK cssinclude %]<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/jquery.rating.css" />[% END %]
 [% END %]
+[% INCLUDE greybox.inc %]
 </head>
 [% INCLUDE 'bodytag.inc' bodyid='opac-detail' bodyclass='scrollto' %]
 [% INCLUDE 'masthead.inc' %]
@@ -38,7 +46,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="[% biblionumber |url %]" class="[% biblionumber | html %]" 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">
+                        [% IF ( OPACURLOpenInNewWindow ) %]
+                            <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 %]
-                        [% IF ( using_https ) %]
                             <img border="0" src="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="Cover image" /></a>
-                        [% ELSE %]
-                            <img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="Cover image" /></a>
-                        [% END %]
                     [% END %]
 
                     [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
                     [% IF ( GoogleJackets ) %]
                         <div title="[% biblionumber |url %]" 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>
+                    [% END %]
                     [% IF OpenLibraryCovers %]
                         <div title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="openlibrary-thumbnail-preview"></div>
                     [% END %]
-                    [% IF ( BakerTaylorEnabled && normalized_isbn ) %]
-                        [% IF ( OPACurlOpenInNewWindow ) %]
-                            <a href="https://[% BakerTaylorBookstoreURL |html %][% normalized_isbn %]" target="_blank"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% normalized_isbn %]" /></a>
+                    [% bt_id = ( normalized_upc || normalized_isbn ) %]
+                    [% IF ( BakerTaylorEnabled && bt_id ) %]
+                        [% IF BakerTaylorBookstoreURL %]
+                            [% IF ( OPACURLOpenInNewWindow ) %]
+                                <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 %]
                         [% ELSE %]
-                            <a href="https://[% BakerTaylorBookstoreURL |html %][% normalized_isbn %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% normalized_isbn %]" /></a>
+                            <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% bt_id %]" />
                         [% END %]
                     [% END %]
                     </div><!-- / #bookcover -->
 
-                    <abbr class="unapi-id" title="koha:biblionumber:[% biblionumber %]"><!-- unAPI --></abbr>
+                    <abbr class="unapi-id" title="koha:biblionumber:[% biblionumber | html %]"><!-- 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=[% biblionumber | html %]">MARC view</a></span>
+                        [% IF ( ISBD ) %]<span class="view"><a id="ISBDview" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% biblionumber | html %]">ISBD view</a></span>[% END %]
                     </div>
                     [% IF ( OPACXSLTDetailsDisplay ) %]
                         [% XSLTBloc %]
                                     [% IF (MARCAUTHOR.authoritylink) %]
                                         <a class='authlink' href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% MARCAUTHOR.authoritylink %]"><img style="vertical-align:middle" height="15" width="15" src="[% interface %]/[% theme %]/images/filefind.png"></a>
                                     [% END %]
+                                    [% IF IDREF and MARCAUTHOR.unimarc3 %]
+                                        <a href="/cgi-bin/koha/opac-idref.pl?unimarc3=[% MARCAUTHOR.unimarc3 %]" title="IdRef" rel="gb_page_center[600,500]">IdRef</a>
+                                    [% END %]
                                     [% UNLESS ( loop.last ) %]|[% END %]
                                 [% END # /FOREACH MARCAUTHORS %]
                             </div>
                         [% 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) %]
                                     [% FOREACH MARCurl IN MARCURLS %]
                                         <li>[% IF ( MARCurl.part ) %][% MARCurl.part %]<br />[% END %]
 
-                                        [% IF ( OPACurlOpenInNewWindow ) %]
+                                        [% 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=[% biblionumber | url %]" 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="[% 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 ) %]
                     [% END # / LibraryThingForLibrariesID %]
 
                     <!--This grabs all of the lists a bib record appears in -->
-                    [% IF ( GetShelves ) %]
+                    [% IF shelves.count %]
                         <span class="results_summary lists"><span class="label">List(s) this item appears in: </span>
-                        [% FOREACH GetShelve IN GetShelves %]
-                            <a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% GetShelve.shelfnumber %]">[% GetShelve.shelfname %]</a>
+                        [% FOREACH s IN shelves %]
+                            <a href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber %]">[% s.shelfname %]</a>
                             [% IF ( loop.last ) %][% ELSE %]|[% END %]
                         [% END %]
                         </span>
-                    [% END # / GetShelves %]
+                    [% END %]
 
                     [% 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[% biblionumber | html %]" method="post" action="/cgi-bin/koha/opac-tags.pl" style="display:none;">
+                                        <label for="newtag[% biblionumber | html %]">New tag(s), separated by a comma:</label>
+                                        <input name="newtag[% biblionumber | html %]" id="newtag[% biblionumber | html %]" maxlength="100" type="text"/>
+                                        <input name="tagbutton" class="btn btn-small tagbutton" title="[% biblionumber | html %]" type="submit" value="Add" />
+                                        <a class="cancel_tag_add" id="cancel[% biblionumber | html %]" href="#">(done)</a>
+                                    </form>
+                                    <span id="newtag[% biblionumber | html %]_status" class="tagstatus" style="display:none;">
+                                        Tag status here.
+                                    </span>
+                                    <a class="tag_add" id="tag_add[% biblionumber | html %]" 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='borrowernumber'  value="[% borrowernumber %]" />
-                                <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="[% biblionumber | html %]" />
+                                <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 ) %]
+                    [% 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 ) %]
-                                        <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 %]
+                                [% IF ( LibraryThingForLibrariesID ) %]
+                                    <li id="tab_LTFLreviews">
+                                        [% IF ( using_https ) %]
+                                            <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 %]
+                                [% END %]
                                 </li>
                             [% END %]
                             [% IF ( SyndeticsAuthorNotes && SYNDETICS_ANOTES ) %]
 
                         [% 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 ) %]
+                        [% 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=[% biblionumber | html %]&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 %]
+                            [% 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 (otheritemloop.size) %]
                                 [% INCLUDE items_table items=otheritemloop tab="otherholdings" %]
                             [% 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 %]
                                     <h3>Table of contents provided by Syndetics</h3>
                                         <ul>
                                             [% FOREACH SYNDETICS_TO IN SYNDETICS_TOC %]
-                                                [% IF ( SYNDETICS_TO.p ) %]
                                                 <li><b>[% SYNDETICS_TO.l %] [% SYNDETICS_TO.t %]</b>[% IF ( SYNDETICS_TO.p ) %] ([% SYNDETICS_TO.p %])[% END %]</li>
-                                                [% END %]
                                             [% END %]
                                         </ul>
                                 </div>
                         [% END # / IF SyndeticsReviews && SYNDETICS_REVIEWS %]
                     [% END # / IF SyndeticsEnabled %]
 
-                    [% IF ( NovelistSelectProfile && NovelistSelectView == 'tab') %]
-                       <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;alerttype=issue&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;alerttype=issue&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>
+                                    <p class="subscription_latestissues"> The [% subscription.opacdisplaycount %] latest issues for this subscription:</p>
                                     <table class="table table-bordered table-striped">
                                         <tr>
                                             <th>Issue #</th>
                                                 <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 %]
+                                                    [% 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>
                                             </tr>
                                     </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=[% biblionumber | html %]">More details</a></p>
                         </div> <!-- / #subscriptions -->
                     [% END # IF subscriptionsnumber %]
 
                             <div id="newcomment"></div>
                                 [% IF ( reviews ) %]
                                     [% FOREACH review IN reviews %]
-                                        [% IF ( review.your_comment ) %]
+                                        [% IF 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 %]
                                                   [% 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=[% biblionumber | html %]'); return false;">
+                                            Post your comments on this item.
                                         </a></div>
                                     [% END %]
                                 [% ELSE %]
                                         <tr>
                                             <td>
                                             [% IF ( OPACAmazonCoverImages ) %]
-                                                <img src="http://images.amazon.com/images/P/[% XISBN.normalized_isbn %].01._AA75_PU_PU-5_.jpg" alt="" />
+                                                <img src="https://images-na.ssl-images-amazon.com/images/P/[% XISBN.normalized_isbn %].01._AA75_PU_PU-5_.jpg" alt="" />
                                             [% END %]
 
                                             [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
                                                 <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=[% biblionumber | html %]&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' ) %]
+                [% 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 id="BW_videos"></div>
                     </div>
                 [% END # / IF Babeltheque %]
-        </div> <!-- /.span8 -->
+
+            [%# 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="span3">
             <div id="ulactioncontainer">
 
                 [% INCLUDE 'opac-detail-sidebar.inc' %]
 
-                [% IF ( NovelistSelectProfile && NovelistSelectView == 'right') %]
+                [% 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 %]
 
                 [% IF ( SocialNetworks ) %]
                     <div id="social_networks" class="clearfix">
                         <span>Share</span>
-                        <div><a id="facebook" href="http://www.facebook.com/sharer.php?u=[% protocol %][% 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=[% protocol %][% 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=[% protocol %][% 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([% protocol %][% current_url |url %])" title="Share by email">Email</a></div>
+                        <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 %]" data-lang="[% lang %]">Tweet</a></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>
                 [% END %]
             </div> <!-- / .ulactioncontainer -->
             [% END %]
         [% END %]
 
-        [% IF ( NovelistSelectProfile ) %]
+        [% IF ( NovelistSelectProfile && normalized_isbn ) %]
             <script type="text/javascript" src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
         [% 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_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>Item holds</th>
+                    <th id="item_holds">Item holds</th>
                 [% ELSIF show_priority %]
-                    <th>Item hold queue priority</th>
+                    <th id="item_priority">Item hold queue priority</th>
                 [% END %]
                 [% IF ( ShowCourseReservesHeader ) %]<th id="item_coursereserves">Course reserves</th>[% END %]
             </tr>
                         [% 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 %]</span>
+                                [% END %]
+                            [% ELSIF ITEM_RESULT.enumchron %]
+                                <span class="enum">[% ITEM_RESULT.enumchron %]</span>
+                            [% ELSIF ITEM_RESULT.serialseq %]
+                                    <span class="serialseq">[% ITEM_RESULT.serialseq %]</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' %]
-                                    <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>
+                                    [% IF Koha.Preference("OPACURLOpenInNewWindow") %]
+                                    <a target="_blank" rel="noreferrer" href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | uri %]&amp;biblionumber=[% biblionumber |url %]&amp;itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url"> Link to resource </a>
+                                    [% ELSE %]
+                                    <a href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | uri %]&amp;biblionumber=[% biblionumber |url %]&amp;itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url"> Link to resource </a>
+                                    [% END %]
+
                                 [% ELSE %]
+                                    [% IF Koha.Preference("OPACURLOpenInNewWindow") %]
+                                    <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 %]
                                 [% END %]
                             [% END %]
                         </td>
                             [% 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>
                         <td>
                             [% IF ITEM_RESULT.course_reserves %]
                                 [% FOREACH r IN ITEM_RESULT.course_reserves %]
-                                    <p>
-                                        <a href="opac-course-details.pl?course_id=[% r.course.course_id %]">
-                                        [% r.course.course_name %]
-                                        <!--[% IF r.course.course_number %] [% r.course.course_number %] [% END %]-->
-                                        [% IF r.course.section %] [% r.course.section %] [% END %]
-                                        [% IF r.course.term %] [% AuthorisedValues.GetByCode( 'TERM', r.course.term ) %] [% END %]
-                                        </a>
-                                    </p>
+                                    [% IF r.course.enabled == 'yes' %]
+                                        <p>
+                                            <a href="opac-course-details.pl?course_id=[% r.course.course_id %]">
+                                            [% r.course.course_name %]
+                                            <!--[% IF r.course.course_number %] [% r.course.course_number %] [% END %]-->
+                                            [% IF r.course.section %] [% r.course.section %] [% END %]
+                                            [% IF r.course.term %] [% AuthorisedValues.GetByCode( 'TERM', r.course.term ) %] [% END %]
+                                            </a>
+                                        </p>
+                                    [% END %]
                                 [% END %]
                             [% END %]
                         </td>
         function highlightOn() {
             var x;
             for (x in q_array) {
-                q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
-                q_array[x] = q_array[x].toLowerCase();
-                var myStopwords = "[% Koha.Preference('NotHighlightedWords') %]".toLowerCase().split('|');
-                if( $.inArray(q_array[x], myStopwords) == -1 ) {
-                    $(".title").highlight(q_array[x]);
-                    $(".author").highlight(q_array[x]);
-                    $(".results_summary").highlight(q_array[x]);
+                if ( q_array[x].length > 0 ) {
+                    q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
+                    q_array[x] = q_array[x].toLowerCase();
+                    var myStopwords = "[% Koha.Preference('NotHighlightedWords') %]".toLowerCase().split('|');
+                    if( $.inArray(q_array[x], myStopwords) == -1 ) {
+                        $(".title").highlight(q_array[x]);
+                        $(".author").highlight(q_array[x]);
+                        $(".results_summary").highlight(q_array[x]);
+                    }
                 }
             }
             $(".highlight_toggle").toggle();
         });
 [% 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 %]
         $(".holdingst").dataTable($.extend(true, {}, dataTablesDefaults, {
             "aoColumns": [
                 [% IF ( item_level_itypes ) %]null,[% END %]
-                null,
-                [% IF ( OpacLocationBranchToDisplay == 'both' ) %]null,[% END %]
+                [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' || singleBranchMode ) %]null,[% END %]
+                [% UNLESS ( singleBranchMode ) %]
+                    [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %]null,[% END %]
+                [% END %]
                 [% IF ( itemdata_ccode ) %]null,[% END %]
                 null,
                 [% IF ( itemdata_enumchron ) %]null,[% END %]
                     null,
                 [% END %]
                 [% IF ( ShowCourseReservesHeader ) %]null,[% END %]
-            ]
+            ],
+            "aaSorting": [[ default_order_index, 'asc' ]]
         }));
 
         [% IF ( query_desc ) %][% IF ( OpacHighlightedWords ) %]var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') |html %]";
             q_array = query_desc.split(" ");
+            q_array = q_array.filter(function(n){ return n }); // Remove empty strings
             highlightOn();
             $("#highlight_toggle_on" ).hide().click(function() {highlightOn() ; return false;});
             $("#highlight_toggle_off").show().click(function() {highlightOff(); return false;});[% END %][% END %]
     [% IF ( GoogleJackets ) %]
         KOHA.Google.GetCoverFromIsbn([% covernewwindow %]);
     [% END %]
+    [% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %]
+        KOHA.coce.getURL('[% Koha.Preference('CoceHost') %]', '[% Koha.Preference('CoceProviders') %]',[% covernewwindow %]);
+    [% END %]
+
     [% IF OpenLibraryCovers %]
         KOHA.OpenLibrary.GetCoverFromIsbn();
     [% END %]
     [% IF OPACLocalCoverImages %]
         KOHA.LocalCover.GetCoverFromBibnumber(true);
     [% END %]
-    [% IF ( NovelistSelectProfile ) %]
-        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 ) %]
                     [% IF ( GoogleJackets ) %]
                       KOHA.Google.GetCoverFromIsbn([% covernewwindow %]);
                     [% END %]
+                    [% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %]
+                      KOHA.coce.getURL('[% Koha.Preference('CoceHost') %]', '[% Koha.Preference('CoceProviders') %]',[% covernewwindow %]);
+                    [% END %]
                     [% IF OpenLibraryCovers %]
                       KOHA.OpenLibrary.GetCoverFromIsbn();
                     [% END %]
                     [% IF ( GoogleJackets ) %]
                       KOHA.Google.GetCoverFromIsbn([% covernewwindow %]);
                     [% END %]
+                    [% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %]
+                      KOHA.coce.getURL('[% Koha.Preference('CoceHost') %]', '[% Koha.Preference('CoceProviders') %]',[% covernewwindow %]);
+                    [% END %]
                     [% IF OpenLibraryCovers %]
                       KOHA.OpenLibrary.GetCoverFromIsbn();
                     [% END %]
               $.post("/cgi-bin/koha/opac-ratings-ajax.pl", {
                 rating_old_value: $("#rating_value").attr("value"),
                 borrowernumber: "[% borrowernumber %]",
-                biblionumber: "[% biblionumber %]",
+                biblionumber: "[% biblionumber | html %]",
                 rating_value: value,
                 auth_error: value
               }, function (data) {
                     $("#rating_value_text").text('');
                   }
 
-                  $("#rating_text").text(_("average rating: ") + data.rating_avg_int + " (" + data.rating_total + ' ' + _("votes") + ")");
+                  $("#rating_text").text(_("average rating: ") + data.rating_avg + " (" + data.rating_total + ' ' + _("votes") + ")");
 
                 }
               }, "json");
         if ($.browser.msie && parseInt($.browser.version, 10) >= 8 && window.XDomainRequest) {
         // Use Microsoft XDR for IE version 8 or above
             var xdr = new XDomainRequest();
-            xdr.open("get", "http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e");
+            xdr.open("get", "https://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e");
             xdr.onload = function() {
                 json = 'json = '+xdr.responseText; // the string now looks like..  json = { ... };
                 eval(json); // json is now a regular JSON object
             }
             xdr.send();
         } else {
-            $.getJSON("http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){
+            $.getJSON("https://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){
                 parseIDBJSON(json);
             });
         }
         function parseIDBJSON( json ) {
             if(json.total_results > 0 && json.book.rating > 0){
                 var isbn = $(".isbn:last").text().split(" ")[1];
-                isbn = isbn.replace(/-/, '');
+                isbn = isbn.replace(/\W+/g, '');
 
                 [% IF ( IDreamBooksReadometer ) %]
-                    $(".title").append('<a href="'+json.book.detail_link+'" id="idreambooksreadometer"><img src="http://idreambooks.com/remotereadometer/'+isbn+'.jpg" alt="'+json.book.title+' by '+json.book.author+'" title="Rating based on reviews of '+json.book.title+'"></a>');
+                    $(".title").append('<a href="'+json.book.detail_link+'" id="idreambooksreadometer"><img src="https://idreambooks.com/remotereadometer/'+isbn+'.jpg" alt="'+json.book.title+_(" by ")+json.book.author+'" title="'+_("Rating based on reviews of ")+json.book.title+'"></a>');
                 [% END %]
 
                 [% IF ( IDreamBooksReviews ) %]
 
                     //append happy-sad cloud review
 
-                    $("#catalogue_detail_biblio").append("<span class='idreambookssummary results_summary'><a href='"+json.book.detail_link+"'><img src='"+json.book.to_read_or_not_small+"' alt='"+json.book.title+" by "+json.book.author+"' title='Rating based on reviews of "+json.book.title+"'>"+json.book.rating+"%</a> <a href='http://www.idreambooks.com/'>rating based on reviews at iDreamBooks.com</a></span>");
+                    $("#catalogue_detail_biblio").append("<span class='idreambookssummary results_summary'><a href='"+json.book.detail_link+"'><img src='"+json.book.to_read_or_not_small+"' alt='"+json.book.title+_(" by ")+json.book.author+"' title='"+_("Rating based on reviews of ")+json.book.title+"'>"+json.book.rating+"%</a> <a href='http://www.idreambooks.com/'>"+_("rating based on reviews at iDreamBooks.com")+"</a></span>");
 
                     //insert data into Book reviews tab
                     $.each(json.book.critic_reviews, function(){
-                            $("#idb_review_snippets").append("<div class='review'><div><a href='"+this.review_link+"'>"+this.source+"</a></div><div>\"..."+this.snippet+"...\"</div><div>Review date: "+this.review_date+"</div><div><a class='reviewlink' href='"+json.book.detail_link+"'>Review result: "+this.pos_or_neg+" <img src='"+this.smiley_or_sad_small+"' alt='iDreamBooks.com rating' title='"+this.pos_or_neg+"' /></a></div></div>");
+                            $("#idb_review_snippets").append("<div class='review'><div><a href='"+this.review_link+"'>"+this.source+"</a></div><div>\"..."+this.snippet+"...\"</div><div>"+_("Review date: ")+this.review_date+"</div><div><a class='reviewlink' href='"+json.book.detail_link+"'>"+_("Review result: ")+this.pos_or_neg+" <img src='"+this.smiley_or_sad_small+"' alt='"+_("iDreamBooks.com rating")+"' title='"+this.pos_or_neg+"' /></a></div></div>");
                             });
                     $("#seemoreidb").attr('href', json.book.detail_link);
                     $("#tab_idb_critic_reviews").show();
                 if (arrPagination[i] == undefined || arrPagination[i].url == "") continue;
                 var li = $("<li id='li_pag_" + i + "' " + ((j % 2 == 0)?"class='highlight'":"")  + " title='" + _("Go to detail") + "' />");
                 var html = "<span class='li_pag_index'>" + i + "</span><a href='" + arrPagination[i].url + "'>" + arrPagination[i].title + "</a>";
-                if (arrPagination[i].author) html += "<br /> by " + arrPagination[i].author;
+                if (arrPagination[i].author) html += "<br /> " + _("by") + " " + arrPagination[i].author;
                 li.html(html);
                 if (highlIndex && i == index) li.css("backgroundColor", "#DDDDDD");
                 ul.append(li);