Bug 20168: Update of the OPAC bootstrap template to bootstrap v4
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-readingrecord.tt
1 [% USE raw %]
2 [% USE Koha %]
3 [% USE KohaDates %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your checkout history</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% BLOCK cssinclude %]
8     <style>ul.ui-tabs-nav li a, ul.ui-tabs-nav li span.a  { padding:0.6em 1em; }</style>
9 [% END %]
10 </head>
11 [% INCLUDE 'bodytag.inc' bodyid='opac-readingrecord' %]
12 [% INCLUDE 'masthead.inc' %]
13 [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
14 [% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
15
16 [% IF Koha.Preference('AmazonAssocTag') %]
17     [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %]
18 [% ELSE %]
19     [% AmazonAssocTag = '' %]
20 [% END %]
21
22 <div class="main">
23     <nav aria-label="breadcrumb">
24         <ul class="breadcrumb">
25             <li class="breadcrumb-item">
26                 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
27             </li>
28             <li class="breadcrumb-item">
29                 <a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
30             </li>
31             <li class="breadcrumb-item" aria-current="page">
32                 <a href="#">Your checkout history</a>
33             </li>
34         </ul>
35     </nav>
36
37     <div class="container-fluid">
38         <div class="row">
39             <div class="col col-lg-2 order-2 order-lg-1">
40                 <div id="navigation">
41                     [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
42                 </div>
43             </div>
44             <div class="col-md-12 col-lg-10 order-1">
45
46                 <div id="userreadingrecord" class="maincontent">
47                     <h3>Checkout history</h3>
48
49                     [% IF READING_RECORD.size == 0 %]
50                         You have never borrowed anything from this library.
51                     [% ELSE %]
52                         <div id="opac-user-readingrec">
53                             <div class="resultscontrol resort">
54                                 <form id="sortform" action="/cgi-bin/koha/opac-readingrecord.pl" method="get">
55                                     [% UNLESS ( limit ) %]<input type="hidden" name="limit" value="full" />[% END %]
56                                     <select name="order" id="order">
57                                         [% IF ( orderbydate ) %]<option value="" selected="selected">Order by date</option>[% ELSE %]<option value="">Order by date</option>[% END %]
58                                         [% IF ( orderbytitle ) %]<option value="title" selected="selected">Order by title</option>[% ELSE %]<option value="title">Order by title</option>[% END %]
59                                         [% IF ( orderbyauthor ) %]<option value="author" selected="selected">Order by author</option>[% ELSE %]<option value="author">Order by author</option>[% END %]
60                                     </select>
61                                     <input type="submit" value="Go" id="sortsubmit" class="submit clearfix" />
62                                 </form>
63                             </div>
64
65                             [% IF limit %]
66                                 <p>
67                                     Showing last 50 items. <a href="/cgi-bin/koha/opac-readingrecord.pl?limit=full[% IF ( orderbytitle ) %]&amp;order=title[% END %]">Show all items</a>
68                                 </p>
69                             [% ELSE %]
70                                 <p>
71                                     Showing all items. <a href="/cgi-bin/koha/opac-readingrecord.pl?limit=50[% IF ( orderbytitle ) %]&amp;order=title[% END %]">Show last 50 items</a>
72                                 </p>
73                             [% END %]
74
75                             [% IF Koha.Preference( 'OnSiteCheckouts' ) == 1 %]
76                             <div id="tabs" class="toptabs">
77                                 <ul>
78                                     <li id="tab_all"><a href="#tabs-container">All</a></li>
79                                     <li id="tab_checkout"><a href="#tabs-container">Checkouts</a></li>
80                                     <li id="tab_onsite_checkout"><a href="#tabs-container">On-site checkouts</a></li>
81                                 </ul>
82                             [% END %]
83                                 <div id="tabs-container" style="overflow:hidden">
84                                     <table id="readingrec" class="table table-bordered table-striped">
85                                         <thead>
86                                             <tr>
87                                                 <th style="display:none;">Type</th>
88                                                 <th class="nosort"></th>
89                                                 <th class="anti-the">Title</th>
90                                                 <th>Item type</th>
91                                                 <th>Call no.</th>
92                                                 <th class="title-string">Date</th>
93                                                 [% IF ( OPACMySummaryHTML ) %]
94                                                     <th>Links</th>
95                                                 [% END %]
96                                             </tr>
97                                         </thead>
98                                         <tbody>
99                                             [% FOREACH issue IN READING_RECORD %]
100                                                 <tr>
101                                                     <td style="display:none;">
102                                                       [% IF issue.onsite_checkout %][% issuetype = 'onsite_checkout' %]
103                                                       [% ELSE %][% issuetype = 'standard_checkout' %]
104                                                       [% END %]
105                                                       [% issuetype | html %]
106                                                     </td>
107                                                 <td>
108                                                     [% IF ( AdlibrisEnabled && issue.normalized_isbn ) %]
109                                                         [% IF issue.BiblioDefaultViewmarc %]
110                                                             <a href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% issue.biblionumber |url %]">
111                                                         [% ELSIF issue.BiblioDefaultViewisbd %]
112                                                             <a href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% issue.biblionumber |url %]">
113                                                         [% ELSE %]
114                                                             <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% issue.biblionumber |url %]">
115                                                         [% END %]
116                                                         <img src="[% AdlibrisURL | html %]?isbn=[% issue.normalized_isbn | html %]" class="adlibris-cover" alt="Adlibris cover image" /></a>
117                                                     [% END %]
118                                                     [% IF  OPACAmazonCoverImages %]
119                                                         [% IF  issue.normalized_isbn %]
120                                                             <a href="http://www.amazon.com/gp/reader/[% issue.normalized_isbn | uri %][% AmazonAssocTag | uri %]#reader-link"><img src="https://images-na.ssl-images-amazon.com/images/P/[% issue.normalized_isbn | html %].01.THUMBZZZ.jpg" alt="" class="item-thumbnail" /></a>
121                                                         [% ELSE %]
122                                                              <span class="no-image">No cover image available</span>
123                                                         [% END %]
124                                                     [% END %]
125
126                                                 [% IF GoogleJackets %]
127                                                     [% IF  issue.normalized_isbn %]
128                                                         <div title="[% issue.biblionumber |url %]" class="[% issue.normalized_isbn | html %]" id="gbs-thumbnail[% loop.count | html %]"></div>
129                                                     [% ELSE %]
130                                                        <span class="no-image">No cover image available</span>
131                                                     [% END %]
132                                                 [% END %]
133
134                                                 [% IF BakerTaylorEnabled %]
135                                                     [% bt_id = ( issue.normalized_upc || issue.normalized_isbn ) %]
136                                                     [% IF ( bt_id ) %]
137                                                        <a href="https://[% BakerTaylorBookstoreURL | uri %][% bt_id | uri %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a>
138                                                     [% ELSE %]
139                                                        <span class="no-image">No cover image available</span>
140                                                     [% END %]
141                                                 [% END %]
142
143                                                 [% IF SyndeticsEnabled && SyndeticsCoverImages %]
144                                                     <img src="https://secure.syndetics.com/index.aspx?isbn=[% issue.normalized_isbn | html %]/SC.GIF&amp;client=[% SyndeticsClientCode | html %]&amp;type=xw10&amp;upc=[% issue.normalized_upc | html %]&amp;oclc=[% issue.normalized_oclc | html %]" alt="" class="item-thumbnail" />
145                                                 [% END %]
146                                                 </td>
147                                                 <td>
148                                                 [% IF  issue.BiblioDefaultViewmarc %]
149                                                      <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% issue.biblionumber |url %]">[% INCLUDE 'biblio-title.inc' biblio=issue %]</a>
150                                                 [% ELSIF issue.BiblioDefaultViewisbd %]
151                                                      <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% issue.biblionumber |url %]">[% INCLUDE 'biblio-title.inc' biblio=issue %]</a>
152                                                 [% ELSE %]
153                                                      <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% issue.biblionumber |url %]">[% INCLUDE 'biblio-title.inc' biblio=issue %]</a>
154                                                 [% END %]
155                                                 <p class="results-summary item-details">[% issue.author | html %]</p>
156
157                                                     [% IF ( Koha.Preference( 'OpacStarRatings' ) == 'all' ) %]
158                                                         [% INCLUDE 'user-star-ratings.inc' item=issue %]
159                                                     [% END %]
160
161                                                 </td>
162                                                 <td>
163                                                 [% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %]
164                                                     [% IF ( issue.imageurl ) %]
165                                                         <img src="[% issue.imageurl | html %]" alt="" />
166                                                     [% END %]
167                                                 [% END %]
168                                                 <span class="tdlabel">Item type:</span>
169                                                 [% issue.translated_description | html %]</td>
170                                                 <td>
171                                                 <span class="tdlabel">Call number:</span>
172                                                 [% issue.itemcallnumber | html %]
173                                                 </td>
174                                                 <td>
175                                                     [% IF issue.returndate %]
176                                                         <span class="tdlabel">Check-in date:</span>
177                                                         <span title="[% issue.returndate | html %]">[% issue.returndate | $KohaDates %]</span>
178                                                     [% ELSE %]
179                                                         <span title="Checked out"><em>(Checked out)</em></span>
180                                                     [% END %]
181                                                 </td>
182                                                 [% IF OPACMySummaryHTML %]
183                                                     <td>[% issue.MySummaryHTML | $raw %]</td>
184                                                 [% END %]
185                                                 </tr>
186                                             [% END # / FOREACH issue %]
187                                         </tbody>
188                                     </table>
189                                 </div> <!-- / .tabs-container -->
190                             [% IF ( Koha.Preference( 'OnSiteCheckouts' ) == 1 ) %]
191                                 </div> <!-- /#tabs -->
192                             [% END %]
193                         </div> <!-- / .opac-user-readingrec -->
194                     [% END # / IF READING_RECORD.size %]
195                 </div> <!-- / .userreadingrecord -->
196             </div> <!-- / .col-lg-10 -->
197         </div> <!-- / .row -->
198     </div> <!-- / .container-fluid -->
199 </div> <!-- / .main -->
200
201 [% INCLUDE 'opac-bottom.inc' %]
202 [% BLOCK jsinclude %]
203 [% INCLUDE 'datatables.inc' %]
204 <script>
205     $(document).ready(function(){
206         [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
207         $('#order').change(function() {
208             $('#sortform').submit();
209         });
210
211         var table = $("#readingrec").dataTable($.extend(true, {}, dataTablesDefaults, {
212             "sPaginationType": "four_button",
213             "columnDefs": [
214                 { "targets": [ "nosort" ],"sortable": false,"searchable": false },
215                 { "type": "anti-the", "targets" : [ "anti-the" ] },
216                 { "type": "title-string", "targets" : [ "title-string" ] }
217             ]
218         }));
219         var tabs = $("#tabs").tabs({
220             activate: function(e, ui) {
221                 var id = $(ui.newTab).attr("id");
222                 if ( id == "tab_checkout" ) {
223                     table.fnFilter("standard_checkout", 0);
224                 } else if ( id == "tab_onsite_checkout" ) {
225                     table.fnFilter("onsite_checkout", 0);
226                 } else { // all
227                     table.fnFilter('', 0);
228                 }
229             }
230         });
231     });
232     var borrowernumber = "[% borrowernumber | html %]";
233     var MSG_YOUR_RATING = _("Your rating: %s, ");
234     var MSG_AVERAGE_RATING = _("Average rating: %s (%s votes)");
235 </script>
236     [% IF ( Koha.Preference('OpacStarRatings') == 'all' ) %]
237         [% Asset.js("lib/jquery/plugins/jquery.barrating.min.js") | $raw %]
238         [% Asset.js("js/ratings.js") | $raw %]
239     [% END %]
240 [% END %]