Bug 21526: Use the 'url' filter when needed
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-showreviews.tt
index a8327e1..80d55ef 100644 (file)
@@ -1,12 +1,13 @@
 [% USE Koha %]
 [% USE KohaDates %]
 
-[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Recent comments
+[% INCLUDE 'doc-head-open.inc' %]
+<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Recent comments</title>
 [% INCLUDE 'doc-head-close.inc' %]
 [% BLOCK cssinclude %][% END %]
-<link rel="alternate" type="application/rss+xml" title="[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog recent comments" href="[% OPACBaseURL %]/cgi-bin/koha/opac-showreviews.pl?format=rss" />
+<link rel="alternate" type="application/rss+xml" title="[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog recent comments" href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-showreviews.pl?format=rss" />
 </head>
-<body id="opac-showreviews" class="scrollto">
+[% INCLUDE 'bodytag.inc' bodyid='opac-showreviews' bodyclass='scrollto' %]
 [% INCLUDE 'masthead.inc' %]
 
     <div class="main">
                     <div class="span12">
                 [% END %]
                    <div id="showreviews" class="searchresults maincontent">
-                        <h3>Recent comments</h3>
+                        <h3>Recent comments <a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-showreviews.pl?format=rss" class="rsssearchlink"><img src="[% interface | html %]/[% theme | html %]/images/feed-icon-16x16.png" alt="Subscribe to recent comments" title="Subscribe to recent comments" border="0" class="rsssearchicon"/></a></h3>
                         <table class="table table-striped">
+                            [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
+                            [% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
                             [% FOREACH review IN reviews %]
                                 <tr>
                                     <td>
                                                     <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% review.biblionumber |url %]#comments" title="View details for this title">
                                                 [% END %]
                                             [% END %]
-                                            [% IF ( review.title ) %][% review.title %][% ELSE %]No title[% END %]
-                                            [% FOREACH subtitl IN review.subtitle %] [% subtitl.subfield |html %][% END %]
+                                            [% IF ( review.title ) %][% review.title | html %][% ELSE %]No title[% END %]
+                                            [% FOREACH subtitl IN review.subtitle %] [% subtitl.subfield | html %][% END %]
                                             </a>
                                             [% IF ( review.author ) %]
-                                                by <a href="/cgi-bin/koha/opac-search.pl?q=au:[% review.author |url %]" title="Search for works by this author" class="author">[% review.author %]</a>
+                                                by <a href="/cgi-bin/koha/opac-search.pl?q=au:[% review.author |url %]" title="Search for works by this author" class="author">[% review.author | html %]</a>
                                             [% END %]
                                         </p>
                                         <p>
                                             <span class="results_summary">
                                                 <span class="label">Publication:</span>
-                                                [% IF ( review.place ) %][% review.place %] [% END %]
-                                                [% IF ( review.publishercode ) %][% review.publishercode %][% END %]
+                                                [% IF ( review.place ) %][% review.place | html %] [% END %]
+                                                [% IF ( review.publishercode ) %][% review.publishercode | html %][% END %]
                                                 [% IF ( review.publicationyear ) %]
-                                                    [% review.publicationyear %]
+                                                    [% review.publicationyear | html %]
                                                 [% ELSE %]
                                                     [% IF ( review.copyrightdate ) %]
-                                                        [% review.copyrightdate %]
+                                                        [% review.copyrightdate | html %]
                                                     [% END %]
                                                 [% END %]
-                                                [% IF ( review.pages ) %]. [% review.pages %][% END %]
-                                                [% IF ( review.notes ) %], [% review.notes %][% END %]
-                                                [% IF ( review.size ) %] [% review.size %][% END %]
+                                                [% IF ( review.pages ) %]. [% review.pages | html %][% END %]
+                                                [% IF ( review.notes ) %], [% review.notes | html %][% END %]
+                                                [% IF ( review.size ) %] [% review.size | html %][% END %]
                                             </span>
                                             [% IF ( review.summary ) %]
                                                 <span class="result_summary">
-                                                    [% review.summary %]
+                                                    [% review.summary | html %]
                                                 </span>
                                             [% END %]
                                             [% IF ( review.copyrightdate ) %]
                                                 <span class="results_summary">
                                                     <span class="label">Date:</span>
-                                                    [% review.copyrightdate %]</span>
+                                                    [% review.copyrightdate | html %]</span>
                                             [% END %]
                                         </p>
 
                                         <p class="commentline[% IF ( review.your_comment ) %] yours[% END %]">
                                             [% IF ( review.avatarurl ) %]
-                                                <img class="avatar" src="[% review.avatarurl %]" height="40" width="40" alt="" />
+                                                <img class="avatar" src="[% review.avatarurl | html %]" height="40" width="40" alt="" />
                                             [% END %]
                                             [% FILTER html_break %]
-                                                [% review.review |html %]
+                                                [% review.review | html %]
                                             [% END %]
-                                        <span style="font-size:87%;font-color:#CCC;">Added [% review.datereviewed | $KohaDates %] [% IF ( review.your_comment ) %] by <strong>you</strong>[% ELSE %]
-                                        [% IF ( review.borrowernumber && ShowReviewer != "none" ) %] by
+                                        <span style="font-size:87%;font-color:#CCC;">
+                                        [% IF review.your_comment %]
+                                            Added [% review.datereviewed | $KohaDates %] by you
+                                        [% ELSE %]
+                                        [% IF ( review.borrowernumber && ShowReviewer != "none" ) %]
+                                            Added [% review.datereviewed | $KohaDates %] by
                                             [% SWITCH ShowReviewer %]
                                             [% CASE 'full' %]
-                                                [% review.borrtitle %] [% review.firstname %] [% review.surname %]
+                                                [% review.borrtitle | html %] [% review.firstname | html %] [% review.surname | html %]
                                             [% CASE 'first' %]
-                                                [% review.firstname %]
+                                                [% review.firstname | html %]
                                             [% CASE 'surname' %]
-                                                [% review.surname %]
+                                                [% review.surname | html %]
                                             [% CASE 'firstandinitial' %]
-                                                [% review.firstname %] [% review.surname|truncate(2,'.') %]
+                                                [% review.firstname | html %] [% review.surname|truncate(2,'.') | html %]
                                             [% CASE 'username' %]
-                                                [% review.userid %]
+                                                [% review.userid | html %]
                                             [% END %]
                                         [% END %][% END %]</span></p>
                                     </td>
                                                 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% review.biblionumber |url %]#comments" title="View details for this title">
                                             [% END %]
                                         [% END %]
-
+                                        [% IF ( AdlibrisEnabled && review.normalized_isbn ) %]
+                                            <img src="[% AdlibrisURL | html %]?isbn=[% review.normalized_isbn | html %]" class="adlibris-cover" alt="Adlibris cover image" />
+                                        [% END %]
                                         [% IF ( OPACAmazonCoverImages ) %]
                                             [% IF ( review.normalized_isbn ) %]
-                                                <img src="http://images.amazon.com/images/P/[% review.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />
+                                                <img src="https://images-na.ssl-images-amazon.com/images/P/[% review.normalized_isbn | html %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />
                                             [% ELSE %]
                                                 <span class="no-image">No cover image available</span>
                                             [% END %]
                                         [% END %]
-
                                         [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
-                                            [% IF ( using_https ) %]
-                                                <img src="https://secure.syndetics.com/index.aspx?isbn=[% review.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% review.normalized_upc %]&amp;oclc=[% review.normalized_oclc %]" alt="" class="thumbnail" />
-                                            [% ELSE %]
-                                                <img src="http://www.syndetics.com/index.aspx?isbn=[% review.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% review.normalized_upc %]&amp;oclc=[% review.normalized_oclc %]" alt="" class="thumbnail" />
-                                            [% END %]
+                                            <img src="https://secure.syndetics.com/index.aspx?isbn=[% review.normalized_isbn | html %]/SC.GIF&amp;client=[% SyndeticsClientCode | html %]&amp;type=xw10&amp;upc=[% review.normalized_upc | html %]&amp;oclc=[% review.normalized_oclc | html %]" alt="" class="thumbnail" />
                                         [% END %]
 
                                         [% IF ( GoogleJackets ) %]
                                             [% IF ( review.normalized_isbn ) %]
-                                                <div style="block" title="[% review.biblionumber |url %]" class="[% review.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></div>
+                                                <div title="[% review.biblionumber |url %]" class="[% review.normalized_isbn | html %]" id="gbs-thumbnail[% loop.count | html %]"></div>
                                             [% ELSE %]
                                                 <span class="no-image">No cover image available</span>
                                             [% END %]
                                         [% END %]
                                             </a>
+                                        [% bt_id = ( review.normalized_upc || review.normalized_isbn ) %]
                                         [% IF ( BakerTaylorEnabled ) %]
-                                            [% IF ( review.normalized_isbn ) %]
-                                                <a href="https://[% review.BakerTaylorBookstoreURL |html %][% review.normalized_isbn %]"><img alt="See Baker &amp; Taylor" src="[% review.BakerTaylorImageURL |html %][% review.normalized_isbn %]" /></a>
+                                            [% IF ( bt_id ) %]
+                                                <a href="https://[% review.BakerTaylorBookstoreURL | uri %][% bt_id | uri %]"><img alt="See Baker &amp; Taylor" src="[% review.BakerTaylorImageURL | html %][% bt_id | html %]" /></a>
                                             [% ELSE %]
                                                 <span class="no-image">No cover image available</span>
                                             [% END %]
                             <div class="pages">
                                 <!-- Row of numbers corresponding to showreviews result pages -->
                                 [% IF ( previous_page_offset ) %]
-                                    <a class="nav" href="/cgi-bin/koha/opac-showreviews.pl?offset=[% previous_page_offset %]">&lt;&lt; Previous</a>
+                                    <a class="nav" href="/cgi-bin/koha/opac-showreviews.pl?offset=[% previous_page_offset | html %]&count=[% results_per_page | html %]">&lt;&lt; Previous</a>
                                 [% ELSE %]
                                     [% IF ( previous_page_first ) %]
-                                        <a class="nav" href="/cgi-bin/koha/opac-showreviews.pl?offset=0">&lt;&lt; Previous</a>
+                                        <a class="nav" href="/cgi-bin/koha/opac-showreviews.pl?offset=0&count=[% results_per_page | html %]">&lt;&lt; Previous</a>
                                     [% END %]
                                 [% END %]
                                 [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %]
                                     [% IF ( PAGE_NUMBER.highlight ) %]
-                                        <span class="current">[% PAGE_NUMBER.pg %]</span>
+                                        <span class="currentPage">[% PAGE_NUMBER.pg | html %]</span>
                                     [% ELSE %]
-                                        <a class="nav" href="/cgi-bin/koha/opac-showreviews.pl?offset=[% PAGE_NUMBER.offset %]">[% PAGE_NUMBER.pg %]</a>
+                                        <a class="nav" href="/cgi-bin/koha/opac-showreviews.pl?offset=[% PAGE_NUMBER.offset | html %]&count=[% results_per_page | html %]">[% PAGE_NUMBER.pg | html %]</a>
                                     [% END %]
                                 [% END %]
                                 [% IF ( next_page_offset ) %]
-                                    <a class="nav" href="/cgi-bin/koha/opac-showreviews.pl?offset=[% next_page_offset %]">Next &gt;&gt;</a>
+                                    <a class="nav" href="/cgi-bin/koha/opac-showreviews.pl?offset=[% next_page_offset | html %]&count=[% results_per_page | html %]">Next &gt;&gt;</a>
                                 [% END %]
                             </div>
                         [% END # / IF PAGE_NUMBERS %]
 
 [% INCLUDE 'opac-bottom.inc' %]
 [% BLOCK jsinclude %]
-<script type="text/javascript">
+<script>
     //<![CDATA[
         $(document).ready(function(){
             [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
         });
     //]]>
 </script>
-[% END %]
\ No newline at end of file
+[% END %]