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);
10 mkurl('',{sort=>field, sort_type=>'asc'}, 1);
13 mkurl('',{sort=>field, sort_type=>'asc'}, 1);
16 [%# SET click_sort = l("click to sort") %]
17 [%# SET click_sort = "title=\"$click_sort\"" %]
19 [%# Produce arrows to indicate the sorting status of the column %]
20 [% MACRO sort_indicator(field)
21 IF (CGI.param('sort') == field);
22 SWITCH CGI.param('sort_type');
24 " <span class=\"column_sort_arrow\">▲</span>";
26 " <span class=\"column_sort_arrow\">▼</span>";
31 [%# Column headers for sortable columns %]
32 [% MACRO sort_head(field, field_label)
34 <a href="[% sort_url(field) %]" [% click_sort %]>[% l(field_label) %]</a>[%- sort_indicator(field) %]