]> git.decadent.org.uk Git - maypole.git/blobdiff - templates/factory/pager
Change author acknowledge to explicit copyright statement.
[maypole.git] / templates / factory / pager
index c10fdeed685a8f4025bc005dcb94b18e87a2e313..6aed9c21c9cf024d31b0d37bdb1bc678069f6d14 100644 (file)
@@ -10,7 +10,7 @@ to the L<Data::Page> interface.
 [%
 IF pager AND pager.first_page != pager.last_page;
 %]
-<p align=center>Pages: 
+<p class="pager">Pages: 
 [%
     SET begin_page = pager.current_page - 10;
     IF begin_page < 1;
@@ -22,14 +22,18 @@ IF pager AND pager.first_page != pager.last_page;
     END;
      FOREACH num = [begin_page .. end_page];
           IF num == pager.current_page;
-            "["; num; "] ";
+            "<span class='current-page'>"; num; "</span>";
           ELSE;
-            SET label = "[" _ num _ "]";
+            SET label = num;
             SET args = "?page=" _ num;
+           SET args = args _ "&order=" _ request.params.order
+             IF request.params.order;
+           SET args = args _ "&amp;o2=desc"
+             IF request.params.o2 == "desc";
             SET action = "list";
             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;