Add grid_index_nav() template def, for page header

This commit is contained in:
Lance Edgar 2016-05-01 18:40:52 -05:00
parent abb42e9f25
commit 4ec8fdcf82

View file

@ -0,0 +1,16 @@
## -*- coding: utf-8 -*-
<%def name="grid_index_nav()">
<div class="grid-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
<span class="viewing">viewing #${'{:,}'.format(grid_index)} of ${'{:,}'.format(grid_count)} results</span>
% 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
</div><!-- grid-nav -->
</%def>