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 [% BLOCK pager_link; %]
14 SET args = "?page=" _ page_num;
15 SET args = args _ "&order=" _ request.params.order IF request.params.order;
16 SET args = args _ "&o2=desc" IF request.params.o2 == "desc";
17 FOR col = pager_columns;
18 IF request.params.$col;
19 SET args = args _ "&" _ col _ "=" _ request.params.$col;
20 SET action = "search";
23 link(classmetadata.table, action, args, label);
31 [% IF pager.first_page == pager.last_page; %]
34 [% pager.current_page %] of [% pager.last_page %] |
37 SET pager_action = request.action;
41 SET pager_columns = classmetadata.columns.list;
44 SET end_page = pager.current_page + 5;
45 SET begin_page = pager.current_page - 5;
51 IF pager.last_page < end_page;
52 SET end_page = pager.last_page;
53 IF (end_page - 10) > 1;
54 begin_page = end_page - 10;
59 PROCESS pager_link page_num = 1, action = pager_action;
62 FOREACH num = [begin_page .. end_page];
63 IF num == pager.current_page;
64 "<span class='current-page'>"; num; "</span>";
66 PROCESS pager_link page_num = num, action = pager_action;
70 IF end_page < pager.last_page;
71 PROCESS pager_link page_num = pager.last_page, action = pager_action;