Bug 29609: Centralized code to build the link to a biblio detail page
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-showreviews.tt
1 [% USE Koha %]
2 [% USE KohaDates %]
3 [% USE AdditionalContents %]
4 [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
5 [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Recent comments &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
8 [% INCLUDE 'doc-head-close.inc' %]
9 [% BLOCK cssinclude %][% END %]
10 <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" />
11 </head>
12 [% INCLUDE 'bodytag.inc' bodyid='opac-showreviews' bodyclass='scrollto' %]
13 [% INCLUDE 'masthead.inc' %]
14
15     <div class="main">
16         <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
17             <ol class="breadcrumb">
18                 <li class="breadcrumb-item">
19                     <a href="/cgi-bin/koha/opac-main.pl">Home</a>
20                 </li>
21                 <li class="breadcrumb-item active">
22                     <a href="#" aria-current="page">Recent comments</a>
23                 </li>
24             </ol>
25         </nav> <!-- /#breadcrumbs -->
26
27         <div class="container-fluid">
28             <div class="row">
29                 [% IF ( OpacNav || OpacNavBottom ) %]
30                     <div class="col-lg-2">
31                         <div id="navigation">
32                             [% INCLUDE 'navigation.inc' %]
33                         </div>
34                     </div>
35                     <div class="col-10 order-first order-md-first order-lg-2">
36                 [% ELSE %]
37                     <div class="col order-first order-md-first order-lg-2">
38                 [% END %]
39                    <div id="showreviews" class="searchresults maincontent">
40                         <h1>Recent comments <a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-showreviews.pl?format=rss" class="rsssearchlink" aria-label="Subscribe to recent comments"><i class="fa fa-rss rsssearchicon" aria-hidden="true" title="Subscribe to recent comments"></i></a></h1>
41                         <table class="table table-striped">
42                             <caption class="sr-only">Comments</caption>
43                             [% FOREACH review IN reviews %]
44                                 <tr>
45                                     <td>
46                                         <p>
47                                             <a class="title" href="[% PROCESS biblio_a_href biblionumber => review.biblionumber %]" title="View details for this title">
48                                                 [% INCLUDE 'biblio-title.inc' biblio=review %]
49                                             </a>
50                                             [% IF ( review.author ) %]
51                                                 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>
52                                             [% END %]
53                                         </p>
54                                         <p>
55                                             <span class="results_summary">
56                                                 <span class="label">Publication:</span>
57                                                 [% IF ( review.place ) %][% review.place | html %] [% END %]
58                                                 [% IF ( review.publishercode ) %][% review.publishercode | html %][% END %]
59                                                 [% IF ( review.publicationyear ) %]
60                                                     [% review.publicationyear | html %]
61                                                 [% ELSE %]
62                                                     [% IF ( review.copyrightdate ) %]
63                                                         [% review.copyrightdate | html %]
64                                                     [% END %]
65                                                 [% END %]
66                                                 [% IF ( review.pages ) %]. [% review.pages | html %][% END %]
67                                                 [% IF ( review.notes ) %], [% review.notes | html %][% END %]
68                                                 [% IF ( review.size ) %] [% review.size | html %][% END %]
69                                             </span>
70                                             [% IF ( review.summary ) %]
71                                                 <span class="result_summary">
72                                                     [% review.summary | html %]
73                                                 </span>
74                                             [% END %]
75                                             [% IF ( review.copyrightdate ) %]
76                                                 <span class="results_summary">
77                                                     <span class="label">Date:</span>
78                                                     [% review.copyrightdate | html %]</span>
79                                             [% END %]
80                                         </p>
81
82                                         <p class="commentline[% IF ( review.your_comment ) %] yours[% END %]">
83                                             [% IF ( review.avatarurl ) %]
84                                                 <img class="avatar" src="[% review.avatarurl | html %]" height="40" width="40" alt="" />
85                                             [% END %]
86                                             [% FILTER html_break %]
87                                                 [% review.review | html %]
88                                             [% END %]
89                                             <span class="commenter">
90                                                 [% IF review.your_comment %]
91                                                     Added [% review.datereviewed | $KohaDates %] by you
92                                                 [% ELSE %]
93                                                     [% IF ( review.borrowernumber && ShowReviewer != "none" ) %]
94                                                         Added [% review.datereviewed | $KohaDates %] by
95                                                         [% SWITCH ShowReviewer %]
96                                                             [% CASE 'full' %]
97                                                                 [% review.borrtitle | html %] [% review.firstname | html %] [% review.surname | html %]
98                                                             [% CASE 'first' %]
99                                                                 [% review.firstname | html %]
100                                                             [% CASE 'surname' %]
101                                                                 [% review.surname | html %]
102                                                             [% CASE 'firstandinitial' %]
103                                                                 [% review.firstname | html %] [% review.surname|truncate(2,'.') | html %]
104                                                             [% CASE 'username' %]
105                                                                 [% review.userid | html %]
106                                                         [% END %]
107                                                     [% END %]
108                                                 [% END %]
109                                             </span>
110                                         </p>
111                                     </td>
112                                     <td>
113                                         <a class="title" href="[% PROCESS biblio_a_href biblionumber => review.biblionumber %]" title="View details for this title">
114                                         [% IF ( OPACAmazonCoverImages ) %]
115                                             [% IF ( review.normalized_isbn ) %]
116                                                 <img src="https://images-na.ssl-images-amazon.com/images/P/[% review.normalized_isbn | html %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />
117                                             [% ELSE %]
118                                                 <span class="no-image">No cover image available</span>
119                                             [% END %]
120                                         [% END %]
121                                         [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
122                                             <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" />
123                                         [% END %]
124
125                                         [% IF ( GoogleJackets ) %]
126                                             [% IF ( review.normalized_isbn ) %]
127                                                 <div title="[% review.biblionumber |url %]" class="[% review.normalized_isbn | html %]" id="gbs-thumbnail[% loop.count | html %]"></div>
128                                             [% ELSE %]
129                                                 <span class="no-image">No cover image available</span>
130                                             [% END %]
131                                         [% END %]
132                                             </a>
133                                         [% bt_id = ( review.normalized_upc || review.normalized_isbn ) %]
134                                         [% IF ( BakerTaylorEnabled ) %]
135                                             [% IF ( bt_id ) %]
136                                                 <a href="https://[% review.BakerTaylorBookstoreURL | uri %][% bt_id | uri %]"><img alt="See Baker &amp; Taylor" src="[% review.BakerTaylorImageURL | html %][% bt_id | html %]" /></a>
137                                             [% ELSE %]
138                                                 <span class="no-image">No cover image available</span>
139                                             [% END %]
140                                         [% END %]
141
142                                         [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %]
143                                             [% SET custom_cover_image_url = review.biblio_object.custom_cover_image_url %]
144                                             [% IF custom_cover_image_url %]
145                                                 <a class="custom_cover_image" href="[% custom_cover_image_url | url %]"><img alt="Cover image" src="[% custom_cover_image_url | url %]" /></a>
146                                             [% END %]
147                                         [% END %]
148
149                                     </td>
150                                 </tr>
151                             [% END # / FOREACH review %]
152                         </table>
153
154                         [% IF ( PAGE_NUMBERS ) %]
155                             <div class="pages">
156                                 <!-- Row of numbers corresponding to showreviews result pages -->
157                                 [% IF ( previous_page_offset ) %]
158                                     <a class="nav" href="/cgi-bin/koha/opac-showreviews.pl?offset=[% previous_page_offset | html %]&count=[% results_per_page | html %]">&lt;&lt; Previous</a>
159                                 [% ELSE %]
160                                     [% IF ( previous_page_first ) %]
161                                         <a class="nav" href="/cgi-bin/koha/opac-showreviews.pl?offset=0&count=[% results_per_page | html %]">&lt;&lt; Previous</a>
162                                     [% END %]
163                                 [% END %]
164                                 [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %]
165                                     [% IF ( PAGE_NUMBER.highlight ) %]
166                                         <span class="currentPage">[% PAGE_NUMBER.pg | html %]</span>
167                                     [% ELSE %]
168                                         <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>
169                                     [% END %]
170                                 [% END %]
171                                 [% IF ( next_page_offset ) %]
172                                     <a class="nav" href="/cgi-bin/koha/opac-showreviews.pl?offset=[% next_page_offset | html %]&count=[% results_per_page | html %]">Next &gt;&gt;</a>
173                                 [% END %]
174                             </div>
175                         [% END # / IF PAGE_NUMBERS %]
176                     </div> <!-- / #showreviews -->
177                 </div> <!-- / .col-lg-10/12 -->
178             </div> <!-- / .row -->
179         </div> <!-- / .container-fluid -->
180     </div> <!-- / .main -->
181
182 [% INCLUDE 'opac-bottom.inc' %]
183 [% BLOCK jsinclude %]
184     [% IF ( GoogleJackets ) %]
185         <script>
186             $(document).ready(function(){
187                 KOHA.Google.GetCoverFromIsbn();
188             });
189         </script>
190     [% END %]
191 [% END %]