<%def name="navlinks(view, curr, last, **kwargs)">
-% if curr != last:
- % if curr != 1:
- <a class="pagination" href="${request.route_url(view, page=curr-1, **kwargs)}" name="Previous Page">previous</a>
- % endif
+% if curr != 1:
+ <a class="pagination" href="${request.route_url(view, page=curr-1, **kwargs)}" name="Previous Page">previous</a>
+% endif
- % if last < 8:
- % for i in range(1, last+1):
+% if last < 8:
+ % for i in range(1, last+1):
+ ${link_page(view, i, curr, **kwargs)}
+ % endfor
+% else:
+ % if curr < 5:
+ % for i in range(1,7):
${link_page(view, i, curr, **kwargs)}
% endfor
- % else:
- % if curr < 5:
- % for i in range(1,7):
- ${link_page(view, i, curr, **kwargs)}
- % endfor
- <span class="pagination">...</span>
- <a class="pagination" href="${request.route_url(view, page=last, **kwargs)}" name="Last Page">${last}</a>
+ <span class="pagination">...</span>
+ <a class="pagination" href="${request.route_url(view, page=last, **kwargs)}" name="Last Page">${last}</a>
- % elif last-curr < 6:
- <a class="pagination" href="${request.route_url(view, page=1, **kwargs)}" name="First Page">1</a>
- <span class="pagination">...</span>
- % for i in range(last-5, last+1):
- ${link_page(view, i, curr, **kwargs)}
- % endfor
- % else:
- <a class="pagination" href="${request.route_url(view, page=1, **kwargs)}" name="First Page">1</a>
+ % elif last-curr < 6:
+ <a class="pagination" href="${request.route_url(view, page=1, **kwargs)}" name="First Page">1</a>
+ <span class="pagination">...</span>
+ % for i in range(last-5, last+1):
+ ${link_page(view, i, curr, **kwargs)}
+ % endfor
+ % else:
+ <a class="pagination" href="${request.route_url(view, page=1, **kwargs)}" name="First Page">1</a>
- <span class="pagination">...</span>
- % for i in range(curr-2, curr+3):
- ${link_page(view, i, curr, **kwargs)}
- % endfor
- <span class="pagination">...</span>
- <a class="pagination" href="${request.route_url(view, page=last, **kwargs)}" name="Last Page">${last}</a>
+ <span class="pagination">...</span>
+ % for i in range(curr-2, curr+3):
+ ${link_page(view, i, curr, **kwargs)}
+ % endfor
+ <span class="pagination">...</span>
+ <a class="pagination" href="${request.route_url(view, page=last, **kwargs)}" name="Last Page">${last}</a>
- % endif
% endif
+% endif
- % if curr != last:
- <a class="pagination" href="${request.route_url(view, page=curr+1, **kwargs)}" name="Next Page">next</a>
- % endif
+% if curr != last:
+ <a class="pagination" href="${request.route_url(view, page=curr+1, **kwargs)}" name="Next Page">next</a>
% endif
</%def>