X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=templates%2Ffactory%2Fpager;h=78c89fd6aa93da92fef0f4d59738b37f52588db5;hb=12d8a77a713d5ed4f08414e5f34e96d45f60e2d3;hp=c10fdeed685a8f4025bc005dcb94b18e87a2e313;hpb=77fb5cc34c9a87077dc65548f0d890b366e78c61;p=maypole.git diff --git a/templates/factory/pager b/templates/factory/pager index c10fdee..78c89fd 100644 --- a/templates/factory/pager +++ b/templates/factory/pager @@ -10,8 +10,12 @@ to the L interface. [% IF pager AND pager.first_page != pager.last_page; %] -

Pages: +

Pages: [% + UNLESS pager_action; + SET pager_action = request.action; + END; + SET begin_page = pager.current_page - 10; IF begin_page < 1; SET begin_page = pager.first_page; @@ -22,18 +26,21 @@ 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 label = "[" _ num _ "]"; + SET label = num; SET args = "?page=" _ num; - SET action = "list"; + SET args = args _ "&order=" _ request.params.order + IF request.params.order; + SET args = args _ "&o2=desc" + IF request.params.o2 == "desc"; FOR col = classmetadata.columns.list; - IF request.query.$col; - SET args = args _ "&" _ col _ "=" _ request.query.$col; + IF request.params.$col; + SET args = args _ "&" _ col _ "=" _ request.params.$col; SET action = "search"; END; END; - link(classmetadata.table, action, args, label); + link(classmetadata.table, pager_action, args, label); END; END; %]