Bug 7413: OPAC bootstrap theme changes
[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
34                 <div id="searchhistory" class="maincontent">
35                     <h1>Search history</h1>
36                         [% IF ( recentSearches ) %]<form action="/cgi-bin/koha/opac-search-history.pl" method="get"><input type="hidden" name="action" value="delete" /><input type="submit" class="btn btn-danger" 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="btn btn-danger" value="Delete your search history" onclick="return confirm(MSG_CONFIRM_DELETE_HISTORY);" /></form>[% END %][% END %]
37
38                         [% IF ( recentSearches ) %]
39                             <table class="historyt table table-bordered table-condensed table-striped">
40                             [% IF ( previousSearches ) %]
41                                 <caption>Current session</caption>
42                             [% END %]
43                                 <thead>
44                                     <tr><th>Date</th><th>Search</th><th>Results</th></tr>
45                                 </thead>
46                                 <tbody>
47                                 [% FOREACH recentSearche IN recentSearches %]
48                                     <tr>
49                                         <td><span title="[% recentSearche.time %]">[% recentSearche.time |$KohaDates with_hours => 1 %]</span></td>
50                                         <td><a href="/cgi-bin/koha/opac-search.pl?[% recentSearche.query_cgi |html %]">[% recentSearche.query_desc |html %]</a></td>
51                                         <td>[% recentSearche.total %]</td>
52                                     </tr>
53                                 [% END %]
54                                 </tbody>
55                             </table>
56                         [% END %]
57
58                         [% IF ( previousSearches ) %]
59                         <table class="historyt table table-bordered table-condensed table-striped">
60                             <caption>Previous sessions</caption>
61                             <thead>
62                                 <tr><th>Date</th><th>Search</th><th>Results</th></tr>
63                             </thead>
64                             <tbody>
65                                 [% FOREACH previousSearche IN previousSearches %]
66                                     <tr>
67                                         <td><span title="[% previousSearche.time %]">[% previousSearche.time |$KohaDates with_hours => 1 %]</span></td>
68                                         <td><a href="/cgi-bin/koha/opac-search.pl?[% previousSearche.query_cgi |html %]">[% previousSearche.query_desc |html %]</a></td>
69                                         <td>[% previousSearche.total %]</td>
70                                     </tr>
71                                 [% END %]
72                             </tbody>
73                         </table>
74                         [% END %]
75
76                         [% UNLESS ( recentSearches ) %]
77                            [% UNLESS ( previousSearches ) %]
78                                 <p>Your search history is empty.</p>
79                             [% END %]
80                         [% END %]
81                      </div>
82                 </div>
83             </div>
84         </div>
85     </div>
86
87 [% INCLUDE 'opac-bottom.inc' %]
88 [% BLOCK jsinclude %]
89 [% INCLUDE 'datatables.inc' %]
90 <script type="text/javascript">
91 //<![CDATA[
92     var MSG_CONFIRM_DELETE_HISTORY = _("Are you sure you want to delete your search history?");
93          $(document).ready(function() {
94             // We show table ordered by descending dates by default
95             // (so that the more recent query is shown first)
96             $(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, {
97                 "aaSorting": [[ 0, "desc" ]],
98                 "aoColumns": [
99                     { "sType": "title-string" },
100                     null,
101                     null
102                 ]
103             }));
104         });
105 //]]>
106
107 </script>
108 [% END %]