Koha/koha-tmpl/opac-tmpl/prog/en/modules/opac-search-history.tt
Galen Charlton 7a967161dc bug 9916: (follow-up) restore default sort order for OPAC search history
To test:

[1] Go to the search history page on the OPAC.
[2] Verify that the searches are sorted in order of decreasing time.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-08-19 14:44:08 +00:00

101 lines
3.6 KiB
Text

[% USE Koha %]
[% USE KohaDates %]
[% INCLUDE 'doc-head-open.inc' %]
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your search history
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'datatables.inc' %]
<script type="text/javascript">
//<![CDATA[
var MSG_CONFIRM_DELETE_HISTORY = _("Are you sure you want to delete your search history?");
$(document).ready(function() {
// We show table ordered by descending dates by default
// (so that the more recent query is shown first)
$(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, {
"aaSorting": [[ 0, "desc" ]],
"aoColumns": [
{ "sType": "title-string" },
null,
null
]
}));
});
//]]>
</script>
</head>
<body id="opac-search-history">
[% IF ( OpacNav ) %]
<div id="doc3" class="yui-t1">
[% ELSIF ( loggedinusername ) %]
<div id="doc3" class="yui-t1">
[% ELSE %]
<div id="doc3" class="yui-t7">
[% END %]
<div id="bd">
[% INCLUDE 'masthead.inc' %]
<div id="yui-main">
<div class="yui-b"><div class="yui-g">
<div id="searchhistory" class="container">
<h1>Search history</h1>
[% 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 %]
[% IF ( recentSearches ) %]
<table class="historyt">
[% IF ( previousSearches ) %]
<caption>Current session</caption>
[% END %]
<thead>
<tr><th>Date</th><th>Search</th><th>Results</th></tr>
</thead>
<tbody>
[% FOREACH recentSearche IN recentSearches %]
<tr>
<td><span title="[% recentSearche.time %]">[% recentSearche.time |$KohaDates with_hours => 1 %]</span></td>
<td><a href="/cgi-bin/koha/opac-search.pl?[% recentSearche.query_cgi |html %]">[% recentSearche.query_desc |html %]</a></td>
<td>[% recentSearche.total %]</td>
</tr>
[% END %]
</tbody>
</table>
[% END %]
[% IF ( previousSearches ) %]
<table class="historyt">
<caption>Previous sessions</caption>
<thead>
<tr><th>Date</th><th>Search</th><th>Results</th></tr>
</thead>
<tbody>
[% FOREACH previousSearche IN previousSearches %]
<tr>
<td><span title="[% previousSearche.time %]">[% previousSearche.time |$KohaDates with_hours => 1 %]</span></td>
<td><a href="/cgi-bin/koha/opac-search.pl?[% previousSearche.query_cgi |html %]">[% previousSearche.query_desc |html %]</a></td>
<td>[% previousSearche.total %]</td>
</tr>
[% END %]
</tbody>
</table>
[% END %]
[% IF ( recentSearches ) %][% ELSE %][% IF ( previousSearches ) %][% ELSE %]<p>Your search history is empty.</p>[% END %][% END %]
</div>
</div>
</div>
</div>
[% IF ( OpacNav ) %]
<div class="yui-b"><div id="leftmenus" class="container">
[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
</div></div>
[% ELSIF ( loggedinusername ) %]
<div class="yui-b"><div id="leftmenus" class="container">
[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
</div></div>
[% ELSE %]
[% END %]
</div>
[% INCLUDE 'opac-bottom.inc' %]