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:
15 SET begin_page = pager.current_page - 10;
17 SET begin_page = pager.first_page;
19 SET end_page = pager.current_page + 10;
20 IF pager.last_page < end_page;
21 SET end_page = pager.last_page;
23 FOREACH num = [begin_page .. end_page];
24 IF num == pager.current_page;
25 "<span class='current-page'>"; num; "</span>";
28 SET args = "?page=" _ num;
30 FOR col = classmetadata.columns.list;
31 IF request.query.$col;
32 SET args = args _ "&" _ col _ "=" _ request.query.$col;
33 SET action = "search";
36 link(classmetadata.table, action, args, label);