X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=templates%2Ffactory%2Fpager;h=6aed9c21c9cf024d31b0d37bdb1bc678069f6d14;hb=3f7c99e168a1d75b133c1e2b25db7b170374d695;hp=5f10f5905830ee5079b075af47f8f81d947f69b4;hpb=52583c3d05f5ceee280e44ad9e6df6759753719c;p=maypole.git diff --git a/templates/factory/pager b/templates/factory/pager index 5f10f59..6aed9c2 100644 --- a/templates/factory/pager +++ b/templates/factory/pager @@ -10,8 +10,7 @@ to the L interface. [% IF pager AND pager.first_page != pager.last_page; %] - -

Pages: +

Pages: [% SET begin_page = pager.current_page - 10; IF begin_page < 1; @@ -23,13 +22,24 @@ IF pager AND pager.first_page != pager.last_page; END; FOREACH num = [begin_page .. end_page]; IF num == pager.current_page; - "["; num; "] "; + ""; num; ""; ELSE; - SET args = "?page=" _ num; # Order? - SET label = "[" _ num _ "]"; - link(classmetadata.table, "list", args, label); + SET label = num; + SET args = "?page=" _ num; + SET args = args _ "&order=" _ request.params.order + IF request.params.order; + SET args = args _ "&o2=desc" + IF request.params.o2 == "desc"; + SET action = "list"; + FOR col = classmetadata.columns.list; + IF request.params.$col; + SET args = args _ "&" _ col _ "=" _ request.params.$col; + SET action = "search"; + END; + END; + link(classmetadata.table, action, args, label); END; END; %] -

+

[% END %]