]> git.decadent.org.uk Git - maypole.git/blob - list
b8f4fb8774925bfd5f24268a81ff4bf3a24bb1f2
[maypole.git] / list
1 [% PROCESS macros %]
2 [% INCLUDE header %]
3 [% INCLUDE title %]
4 [% IF search %]
5     <div id="title">Search results</div>
6 [% ELSE %]
7     <div id="title">Listing of all [% classmetadata.plural %]</div>
8 [% END %]
9 [% INCLUDE navbar %]
10 <div class="list">
11     <table id="matrix" width="100%" >
12         <tr>
13             [% FOR col = classmetadata.list_columns.list;
14                 NEXT IF col == "id";
15                 "<th>"; 
16                 SET additional = "?order=" _ col;
17                 SET additional = additional _ "&amp;page=" _ pager.current_page
18                     IF pager;
19                 SET additional = additional _ "&amp;o2=desc" 
20                 IF col == request.query.order and request.query.o2 != "desc";
21                 link(classmetadata.table, "list", additional,
22                     classmetadata.colnames.$col);
23                 IF col == request.query.order;
24                     IF request.query.o2 != "desc";
25                         "&darr;";
26                     ELSE;
27                         "&uarr;";
28                     END;
29                 END;
30                 "</th>";
31             END %]
32             <th id="actionth">Actions</th>
33         </tr>
34         [%  SET count = 0;
35         FOR item = objects;
36             SET count = count + 1;
37             "<tr";
38             ' class="alternate"' IF count % 2;
39             ">";
40             display_line(item);
41             "</tr>";
42         END %]
43     </table>
44
45 [% INCLUDE pager %]
46 [% INCLUDE addnew %]
47 [% INCLUDE search_form %]
48 </div>
49 [% INCLUDE footer %]