terom@76: <%def name="paginate(url, count, page_cur, page_max, _more=None, _last=False, **args)">
terom@76: <%doc>
terom@76: Pagination works using page numbers, with a specific number of maximum pages displayed. If _more is True,
terom@76: then instead of a "Next" button, we have a "More" button, which goes to the max+1'th page, unless _last is
terom@76: True, whereupon it's not displayed
terom@76: %doc>
terom@76:
terom@76:
terom@76: -
terom@76: % if page_cur > 1 :
terom@76: « Prev
terom@76: % else :
terom@76: « Prev
terom@76: %endif
terom@76:
terom@76: % for page in xrange(1, page_max + 1) :
terom@76: -
terom@76: % if page == page_cur :
terom@76: ${page}
terom@76: % else :
terom@76: ${page}
terom@76: % endif
terom@76:
terom@76: % endfor
terom@76: -
terom@76: % if _more and _last :
terom@76: More »
terom@76: % elif _more :
terom@76: More »
terom@76: % elif page_cur == page_max : ## last page
terom@76: Next »
terom@76: % else :
terom@76: Next »
terom@76: % endif
terom@76:
terom@76:
terom@76:
terom@76: %def>
terom@76: