5 This controls the pager display at the bottom (by default) of the list
6 and search views. It expects a C<pager> template argument which responds
7 to the L<Data::Page> interface.
11 IF pager AND pager.first_page != pager.last_page;
13 <p class="pager">Pages:
16 SET pager_action = request.action;
19 SET begin_page = pager.current_page - 10;
21 SET begin_page = pager.first_page;
23 SET end_page = pager.current_page + 10;
24 IF pager.last_page < end_page;
25 SET end_page = pager.last_page;
27 FOREACH num = [begin_page .. end_page];
28 IF num == pager.current_page;
29 "<span class='current-page'>"; num; "</span>";
32 SET args = "?page=" _ num;
33 SET args = args _ "&order=" _ request.params.order
34 IF request.params.order;
35 SET args = args _ "&o2=desc"
36 IF request.params.o2 == "desc";
37 FOR col = classmetadata.columns.list;
38 IF request.params.$col;
39 SET args = args _ "&" _ col _ "=" _ request.params.$col;
40 SET action = "search";
43 link(classmetadata.table, pager_action, args, label);