From 4ec8fdcf8281fe5d33c9195b5e2c33437d1adab6 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 1 May 2016 18:40:52 -0500 Subject: [PATCH] Add `grid_index_nav()` template def, for page header --- tailbone/templates/newgrids/nav.mako | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tailbone/templates/newgrids/nav.mako diff --git a/tailbone/templates/newgrids/nav.mako b/tailbone/templates/newgrids/nav.mako new file mode 100644 index 00000000..864e09aa --- /dev/null +++ b/tailbone/templates/newgrids/nav.mako @@ -0,0 +1,16 @@ +## -*- coding: utf-8 -*- +<%def name="grid_index_nav()"> +
+ % if grid_index > 1: + ${h.link_to(u"« Previous", '{}?index={}'.format(url('{}.view_index'.format(route_prefix)), grid_index - 1), class_='button')} + % else: + ${h.link_to(u"« Previous", '#', class_='button', disabled='disabled')} + % endif + viewing #${'{:,}'.format(grid_index)} of ${'{:,}'.format(grid_count)} results + % if grid_index < grid_count: + ${h.link_to(u"Next »", '{}?index={}'.format(url('{}.view_index'.format(route_prefix)), grid_index + 1), class_='button')} + % else: + ${h.link_to(u"Next »", '#', class_='button', disabled='disabled')} + % endif +
+