Bug 24224: Convert OpacNavBottom system preference to additional content
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-topissues.tt
1 [% USE Koha %]
2 [% USE Branches %]
3 [% USE AuthorisedValues %]
4 [% USE ItemTypes %]
5 [% USE AdditionalContents %]
6 [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
7 [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Most popular titles &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 [% BLOCK cssinclude %]
12     <style>
13         #search-facets fieldset {
14             border: 0;
15             margin: 0;
16             padding: .3em;
17         }
18         #search-facets ol{
19             padding: .3em;
20         }
21         #search-facets li {
22             list-style-type: none;
23             padding: 4px 4px;
24         }
25         #search-facets label{
26             font-weight: bold;
27             display: block;
28             margin: .2em 0;
29         }
30         #search-facets fieldset.action {
31             padding-left: 4px;
32             margin: .3em;
33         }
34         #search-facets select {
35             max-width: 100%;
36         }
37     </style>
38 [% END %]
39 </head>
40 [% INCLUDE 'bodytag.inc' bodyid='opac-topissues' bodyclass='scrollto' %]
41 [% INCLUDE 'masthead.inc' %]
42
43     <div class="main">
44         <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
45             <ol class="breadcrumb">
46                 <li class="breadcrumb-item">
47                     <a href="/cgi-bin/koha/opac-main.pl">Home</a>
48                 </li>
49                 <li class="breadcrumb-item active">
50                     <a href="#" aria-current="page">Most popular titles</a>
51                 </li>
52             </ol>
53         </nav> <!-- /#breadcrumbs -->
54
55         <div class="container-fluid">
56             <div class="row">
57                 <div class="col-lg-2">
58                     <div id="usertopissues">
59                         [% INCLUDE 'opac-topissues.inc' %]
60                         [% IF ( OpacNav || OpacNavBottom ) %]
61                             [% INCLUDE 'navigation.inc' %]
62                         [% END %]
63                     </div>
64                 </div>
65                 <div class="col-10 order-first order-md-first order-lg-2">
66                     <div id="topissues" class="maincontent">
67
68                         <h1>Top issues</h1>
69
70                         [% IF ( results ) %]
71                             <table id="topissuest" class="table table-bordered table-striped">
72                                 <caption>
73                                     The [% limit | html %] most checked-out
74                                     [% IF selected_itemtype %]
75                                         [% ItemTypes.GetDescription(selected_itemtype) | html %]
76                                     [% END %]
77                                     [% IF ( branch ) %]
78                                         at
79                                         [% Branches.GetName( branch ) | html %]
80                                     [% END %]
81                                     [% IF ( timeLimit != 999 ) %]
82                                         in the past [% timeLimitFinite | html %] months
83                                     [% ELSE %]
84                                          of all time
85                                      [% END %]
86                                 </caption>
87                                 <thead>
88                                     <tr>
89                                         <th class="anti-the">Title</th>
90                                         <th>[% IF ( ccodesearch ) %]Collection[% ELSE %]Item type[% END %]</th>
91                                         <th class="title-num">Checkouts</th>
92                                         [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
93                                             <th class="NoSort">&nbsp;</th>
94                                         [% END %]
95                                     </tr>
96                                 </thead>
97                                 <tbody>
98                                     [% FOREACH result IN results %]
99                                         <tr>
100                                             <td>
101                                                 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% result.biblionumber | html %]">[% result.title | html %]</a><p>[% result.author | html %]
102                                                     [% IF ( result.publishercode ) %]- [% result.publishercode | html %][% END %]
103                                                     [% IF ( result.place ) %][% result.place | html %][% END %]
104                                                     [% IF ( result.publicationyear ) %]
105                                                         [% result.publicationyear | html %]
106                                                     [% ELSIF ( result.copyrightdate ) %]
107                                                         [% result.copyrightdate | html %]
108                                                     [% END %]
109                                                     [% IF ( result.pages ) %] - [% result.pages | html %][% END %]
110                                                     [% IF ( result.item('size') ) %][% result.item('size') | html %][% END %]</p>
111                                             </td>
112                                             <td>
113                                                 [% IF Koha.Preference('AdvancedSearchTypes') == 'ccode' %]
114                                                     <span class="tdlabel">Collection</span>
115                                                     [% AuthorisedValues.GetByCode('ccode', result.ccode, 1) | html %]
116                                                 [% ELSE %]
117                                                     <span class="tdlabel">Item type</span>
118                                                     [% ItemTypes.GetDescription(result.itemtype) | html %]
119                                                 [% END %]
120                                             </td>
121                                             <td>
122                                                 <span class="tdlabel">Checkouts: </span>
123                                                 <span title="[% result.count | html %]">[% result.count | html %]</span>
124                                             </td>
125                                             [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
126                                                 <td>
127                                                     [% IF Koha.Preference( 'OPACHoldRequests' ) == 1 %]
128                                                         [% UNLESS ( result.norequests ) %]
129                                                             <a class="btn btn-link btn-sm hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% result.biblionumber | uri %]"><i class="fa fa-fw fa-bookmark" aria-hidden="true"></i> Place hold</a>
130                                                         [% END %]
131                                                     [% END %]
132                                                 </td>
133                                             [% END %]
134                                         </tr>
135                                     [% END %]
136                                 </tbody>
137                             </table>
138                         [% ELSE %]
139                             No results, try to change filters.
140                         [% END # / IF results %]
141                     </div> <!-- / #topissues -->
142                 </div> <!-- / .col-lg-10 -->
143             </div> <!-- / .row -->
144         </div> <!-- / .container-fluid -->
145     </div> <!-- / .main -->
146
147 [% INCLUDE 'opac-bottom.inc' %]
148 [% BLOCK jsinclude %]
149     [% INCLUDE 'datatables.inc' %]
150     <script>
151         $(function() {
152             $("#topissuest").dataTable($.extend(true, {}, dataTablesDefaults, {
153                 "sorting": [[2, "desc"]],
154                 "columnDefs": [
155                     { "sortable": false, "searchable": false, 'targets': [ 'NoSort' ] },
156                     { "type": "anti-the", "targets" : [ "anti-the" ] },
157                     { "type": "title-numeric", "targets" : [ "title-num"] },
158                 ]
159             }));
160         });
161         function Dopop(link) {
162             newin=window.open(link,'width=500,height=400,toolbar=false,scrollbars=yes');
163         }
164     </script>
165 [% END %]