Bug 5672: Gives RSS icons to catalog search history
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-search-history.tt
1 [% USE Koha %]
2 [% USE KohaDates %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your search history
5 [% INCLUDE 'doc-head-close.inc' %]
6 [% BLOCK cssinclude %][% END %]
7 </head>
8 <body id="opac-search-history" class="scrollto">
9 [% INCLUDE 'masthead.inc' %]
10
11 <div class="main">
12     <ul class="breadcrumb">
13         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
14         [% IF ( loggedinusername ) %]
15             <li><a href="#">Your search history</a></li>
16         [% ELSE %]
17             <li><a href="#">Search history</a></li>
18         [% END %]
19     </ul>
20
21     <div class="container-fluid">
22         <div class="row-fluid">
23             [% IF ( OpacNav||loggedinusername ) %]
24                 <div class="span2">
25                     <div id="navigation">
26                         [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
27                     </div>
28                 </div>
29                 <div class="span10">
30             [% ELSE %]
31                 <div class="span12">
32             [% END %]
33                 <div id="searchhistory" class="maincontent">
34                     <h1>Search history</h1>
35
36                     [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]
37                       <div id="tabs" class="toptabs">
38                         <ul>
39                           <li><a href="#biblio_tab">Catalog searches</a></li>
40                           <li><a href="#authority_tab">Authority searches</a></li>
41                         </ul>
42                     [% END %]
43                       <div id="biblio_tab">
44                         [% IF ( current_biblio_searches ) %]
45                           <h2>Current session</h2>
46                           <form action="/cgi-bin/koha/opac-search-history.pl" method="get">
47                             <input type="hidden" name="action" value="delete" />
48                             <input type="hidden" name="previous" value="0" />
49                             <input type="hidden" name="type" value="biblio" />
50                             <input type="submit" class="deleteshelf" value="Delete your current catalog history" onclick="return confirm(MSG_CONFIRM_DELETE_HISTORY);" />
51                           </form>
52                           <table class="historyt table table-bordered table-condensed table-striped">
53                             <thead>
54                               <tr>
55                                 <th>Date</th>
56                                 <th>Subscribe</th>
57                                 <th>Search</th>
58                                 <th>Results</th>
59                               </tr>
60                             </thead>
61                             <tbody>
62                             [% FOREACH s IN current_biblio_searches %]
63                               <tr>
64                                 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
65                                 <td><a href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html |url %][% limit_cgi |html | url %]&amp;[% s.query_cgi |html %]&amp;count=[% countrss |html %]&amp;sort_by=acqdate_dsc&amp;format=rss2" class="rsssearchlink"><img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png" alt="Subscribe to this search" title="Subscribe to this search" class="rsssearchicon"/></a></td>
66                                 <td><a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
67                                 <td>[% s.total %]</td>
68                               </tr>
69                             [% END %]
70                             </tbody>
71                           </table>
72                         [% END %]
73
74                         [% IF ( previous_biblio_searches ) %]
75                           <h2>Previous sessions</h2>
76                           <form action="/cgi-bin/koha/opac-search-history.pl" method="get">
77                             <input type="hidden" name="action" value="delete" />
78                             <input type="hidden" name="previous" value="1" />
79                             <input type="hidden" name="type" value="biblio" />
80                             <input type="submit" class="deleteshelf" value="Delete your previous catalog search history" onclick="return confirm(MSG_CONFIRM_DELETE_HISTORY);" />
81                           </form>
82                           <table class="historyt table table-bordered table-condensed table-striped">
83                             <thead>
84                               <tr>
85                                 <th>Date</th>
86                                 <th>Subscribe</th>
87                                 <th>Search</th>
88                                 <th>Results</th>
89                               </tr>
90                             </thead>
91                             <tbody>
92                             [% FOREACH s IN previous_biblio_searches %]
93                               <tr>
94                                 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
95                                 <td><a href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html |url %][% limit_cgi |html | url %]&amp;[% s.query_cgi |html %]&amp;count=[% countrss |html %]&amp;sort_by=acqdate_dsc&amp;format=rss2" class="rsssearchlink"><img src="[% interface %]/[% theme %]/images/feed-icon-16x16.png" alt="Subscribe to this search" title="Subscribe to this search" class="rsssearchicon"/></a></td>
96                                 <td><a href="/cgi-bin/koha/opac-search.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
97                                 <td>[% s.total %]</td>
98                               </tr>
99                             [% END %]
100                             </tbody>
101                           </table>
102                         [% END %]
103
104                         [% IF !current_biblio_searches && !previous_biblio_searches %]
105                           <p>Your catalog search history is empty.</p>
106                         [% END %]
107                       </div>
108
109
110                     [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]
111                       <div id="authority_tab">
112                         [% IF ( current_authority_searches ) %]
113                           <h2>Current session</h2>
114                           <form action="/cgi-bin/koha/opac-search-history.pl" method="get">
115                             <input type="hidden" name="action" value="delete" />
116                             <input type="hidden" name="previous" value="0" />
117                             <input type="hidden" name="type" value="authority" />
118                             <input type="submit" class="deleteshelf" value="Delete your current authority search history" onclick="return confirm(MSG_CONFIRM_DELETE_HISTORY);" />
119                           </form>
120                           <table class="historyt table table-bordered table-condensed table-striped">
121                             <thead>
122                               <tr>
123                                 <th>Date</th>
124                                 <th>Search</th>
125                                 <th>Results</th>
126                               </tr>
127                             </thead>
128                             <tbody>
129                             [% FOREACH s IN current_authority_searches %]
130                               <tr>
131                                 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
132                                 <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
133                                 <td>[% s.total %]</td>
134                               </tr>
135                             [% END %]
136                             </tbody>
137                           </table>
138                         [% END %]
139
140                         [% IF ( previous_authority_searches ) %]
141                           <h2>Previous sessions</h2>
142                           <form action="/cgi-bin/koha/opac-search-history.pl" method="get">
143                             <input type="hidden" name="action" value="delete" />
144                             <input type="hidden" name="previous" value="1" />
145                             <input type="hidden" name="type" value="authority" />
146                             <input type="submit" class="deleteshelf" value="Delete your previous authority search history" onclick="return confirm(MSG_CONFIRM_DELETE_HISTORY);" />
147                           </form>
148                           <table class="historyt table table-bordered table-condensed table-striped">
149                             <thead>
150                               <tr>
151                                 <th>Date</th>
152                                 <th>Search</th>
153                                 <th>Results</th>
154                               </tr>
155                             </thead>
156                             <tbody>
157                             [% FOREACH s IN previous_authority_searches %]
158                               <tr>
159                                 <td><span title="[% s.time %]">[% s.time |$KohaDates with_hours => 1 %]</span></td>
160                                 <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi |html %]">[% s.query_desc |html %]</a></td>
161                                 <td>[% s.total %]</td>
162                               </tr>
163                             [% END %]
164                             </tbody>
165                           </table>
166                         [% END %]
167
168                         [% IF !current_authority_searches && !previous_authority_searches %]
169                           <p>Your authority search history is empty.</p>
170                         [% END %]
171                       </div>
172                     </div>
173                     [% END %]
174                     </div>
175                 </div>
176             </div>
177         </div>
178     </div>
179
180 [% INCLUDE 'opac-bottom.inc' %]
181 [% BLOCK jsinclude %]
182 [% INCLUDE 'datatables.inc' %]
183 <script type="text/javascript">
184 //<![CDATA[
185     var MSG_CONFIRM_DELETE_HISTORY = _("Are you sure you want to delete your search history?");
186          $(document).ready(function() {
187             // We show table ordered by descending dates by default
188             // (so that the more recent query is shown first)
189             $(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, {
190                 "aaSorting": [[ 0, "desc" ]],
191                 "aoColumns": [
192                     { "sType": "title-string" },
193                     null,
194                     null
195                 ]
196             }));
197         });
198
199     [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]$('#tabs').tabs();[% END %]
200 //]]>
201
202 </script>
203 [% END %]