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