bug 9916: (follow-up) restore default sort order for OPAC search history
[koha.git] / koha-tmpl / opac-tmpl / prog / 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 [% INCLUDE 'datatables.inc' %]
7 <script type="text/javascript">
8 //<![CDATA[
9         var MSG_CONFIRM_DELETE_HISTORY = _("Are you sure you want to delete your search history?");
10          $(document).ready(function() {
11                 // We show table ordered by descending dates by default
12                 // (so that the more recent query is shown first)
13             $(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, {
14                 "aaSorting": [[ 0, "desc" ]],
15                 "aoColumns": [
16                     { "sType": "title-string" },
17                     null,
18                     null
19                 ]
20             }));
21         });
22 //]]>
23
24 </script>
25 </head>
26 <body id="opac-search-history">
27 [% IF ( OpacNav ) %]
28 <div id="doc3" class="yui-t1">
29 [% ELSIF ( loggedinusername ) %]
30 <div id="doc3" class="yui-t1">
31 [% ELSE %]
32 <div id="doc3" class="yui-t7">
33 [% END %]
34    <div id="bd">
35 [% INCLUDE 'masthead.inc' %]
36
37         <div id="yui-main">
38 <div class="yui-b"><div class="yui-g">
39         <div id="searchhistory" class="container">
40         <h1>Search history</h1>
41         [% IF ( recentSearches ) %]<form action="/cgi-bin/koha/opac-search-history.pl" method="get"><input type="hidden" name="action" value="delete" /><input type="submit" class="deleteshelf" value="Delete your search history" onclick="return confirm(MSG_CONFIRM_DELETE_HISTORY);" /></form>[% ELSE %][% IF ( previousSearches ) %]<form action="/cgi-bin/koha/opac-search-history.pl" method="get"><input type="hidden" name="action" value="delete" /><input type="submit" class="deleteshelf" value="Delete your search history" onclick="return confirm(MSG_CONFIRM_DELETE_HISTORY);" /></form>[% END %][% END %]
42
43             [% IF ( recentSearches ) %]
44             <table class="historyt">
45             [% IF ( previousSearches ) %]
46             <caption>Current session</caption>
47             [% END %]
48                 <thead>
49                     <tr><th>Date</th><th>Search</th><th>Results</th></tr>
50                 </thead>
51                 <tbody>
52                     [% FOREACH recentSearche IN recentSearches %]
53                     <tr>
54             <td><span title="[% recentSearche.time %]">[% recentSearche.time |$KohaDates with_hours => 1 %]</span></td>
55                         <td><a href="/cgi-bin/koha/opac-search.pl?[% recentSearche.query_cgi |html %]">[% recentSearche.query_desc |html %]</a></td>
56                         <td>[% recentSearche.total %]</td>
57                     </tr>
58                     [% END %]
59                 </tbody>
60             </table>
61             [% END %]
62
63             [% IF ( previousSearches ) %]
64             <table class="historyt">
65             <caption>Previous sessions</caption>
66                 <thead>
67                     <tr><th>Date</th><th>Search</th><th>Results</th></tr>
68                 </thead>
69                 <tbody>
70                     [% FOREACH previousSearche IN previousSearches %]
71                     <tr>
72             <td><span title="[% previousSearche.time %]">[% previousSearche.time |$KohaDates with_hours => 1 %]</span></td>
73                         <td><a href="/cgi-bin/koha/opac-search.pl?[% previousSearche.query_cgi |html %]">[% previousSearche.query_desc |html %]</a></td>
74                         <td>[% previousSearche.total %]</td>
75                     </tr>
76                     [% END %]
77                 </tbody>
78             </table>
79             [% END %]
80
81 [% IF ( recentSearches ) %][% ELSE %][% IF ( previousSearches ) %][% ELSE %]<p>Your search history is empty.</p>[% END %][% END %]
82
83      </div>
84      </div>
85      </div>
86      </div>
87
88 [% IF ( OpacNav ) %]
89 <div class="yui-b"><div id="leftmenus" class="container">
90 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
91 </div></div>
92 [% ELSIF ( loggedinusername ) %]
93 <div class="yui-b"><div id="leftmenus" class="container">
94 [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
95 </div></div>
96 [% ELSE %]
97 [% END %]
98
99
100 </div>
101 [% INCLUDE 'opac-bottom.inc' %]