aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2013-02-05 15:44:11 +0000
committerMatthew Somerville <matthew@mysociety.org>2013-02-05 16:07:53 +0000
commit1cbacdf3d0bdbe6696048260fc224cf9a6d691f9 (patch)
tree386f2debc9385911c6681a1ccccbc3d8001841e1
parentd7eb95f958b12eff189d3581540766b636b3b9b6 (diff)
Consolidate pagination template.
-rw-r--r--templates/web/default/admin/reports.html2
-rw-r--r--templates/web/default/pagination.html20
-rw-r--r--templates/web/fixmystreet/pagination.html15
-rw-r--r--templates/web/zurich/admin/reports.html2
4 files changed, 14 insertions, 25 deletions
diff --git a/templates/web/default/admin/reports.html b/templates/web/default/admin/reports.html
index 415d94cac..fab12cfce 100644
--- a/templates/web/default/admin/reports.html
+++ b/templates/web/default/admin/reports.html
@@ -24,6 +24,8 @@
[% INCLUDE 'admin/problem_row.html' %]
</table>
+[% INCLUDE 'pagination.html', admin = 1, param = 'p' IF pager %]
+
[% END %]
[% INCLUDE 'admin/list_updates.html' %]
diff --git a/templates/web/default/pagination.html b/templates/web/default/pagination.html
index f5a1192d1..f1a114df6 100644
--- a/templates/web/default/pagination.html
+++ b/templates/web/default/pagination.html
@@ -1,17 +1,19 @@
[% IF pager.last_page > 1 %]
- <p>
+[% IF NOT admin %]
+<section class="full-width">
+[% END %]
+ <p class="pagination">
[% IF pager.previous_page %]
- <a href="[% c.req.uri_with({ $param => pager.previous_page }) %]">&larr; Previous</a>
- [% ELSE %]
- &larr; Previous
+ <a class="prev" href="[% c.req.uri_with({ $param => pager.previous_page }) %]">Previous</a>
[% END %]
- |
+
[% pager.first %] to [% pager.last %] of [% pager.total_entries %]
- |
+
[% IF pager.next_page %]
- <a href="[% c.req.uri_with({ $param => pager.next_page }) %]">Next &rarr;</a>
- [% ELSE %]
- Next &rarr;
+ <a class="next" href="[% c.req.uri_with({ $param => pager.next_page }) %]">Next</a>
[% END %]
</p>
+[% IF NOT admin %]
+</section>
+[% END %]
[% END %]
diff --git a/templates/web/fixmystreet/pagination.html b/templates/web/fixmystreet/pagination.html
deleted file mode 100644
index 4f4d00a79..000000000
--- a/templates/web/fixmystreet/pagination.html
+++ /dev/null
@@ -1,15 +0,0 @@
-[% IF pager.last_page > 1 %]
-<section class="full-width">
- <p class="pagination">
- [% IF pager.previous_page %]
- <a class="prev" href="[% c.req.uri_with({ $param => pager.previous_page }) %]">Previous</a>
- [% END %]
-
- [% pager.first %] to [% pager.last %] of [% pager.total_entries %]
-
- [% IF pager.next_page %]
- <a class="next" href="[% c.req.uri_with({ $param => pager.next_page }) %]">Next</a>
- [% END %]
- </p>
-</section>
-[% END %]
diff --git a/templates/web/zurich/admin/reports.html b/templates/web/zurich/admin/reports.html
index e78383334..97d0aff7b 100644
--- a/templates/web/zurich/admin/reports.html
+++ b/templates/web/zurich/admin/reports.html
@@ -20,7 +20,7 @@
[% INCLUDE 'admin/problem_row.html', page = 'search' %]
</table>
-[% INCLUDE 'pagination.html', param = 'p' IF pager %]
+[% INCLUDE 'pagination.html', admin = 1, param = 'p' IF pager %]
[% END %]