1 [%# Produce a URL for a given field that cycles for sorting from
2 "nothing" to "ascending" to "descending" then back to "nothing".
4 [% MACRO sort_url(field)
5 IF (CGI.param('sort') == field);
6 SWITCH CGI.param('sort_type');
8 mkurl('',{sort=>field, sort_type=>'desc'},1);
12 mkurl('',{sort=>field, sort_type=>'asc'}, 1);
15 mkurl('',{sort=>field, sort_type=>'asc'}, 1);
18 [%# SET click_sort = l("click to sort") %]
19 [%# SET click_sort = "title=\"$click_sort\"" %]
21 [%# Produce arrows to indicate the sorting status of the column %]
22 [% MACRO sort_indicator(field)
23 IF (CGI.param('sort') == field);
24 SWITCH CGI.param('sort_type');
26 " <span class=\"column_sort_arrow\">▲</span>";
28 " <span class=\"column_sort_arrow\">▼</span>";
33 [%# Column headers for sortable columns %]
34 [% MACRO sort_head(field, field_label)
36 <a href="[% sort_url(field) %]" [% click_sort %]>[% l(field_label) %]</a>[%- sort_indicator(field) %]