templates/inc_paginate.tmpl
changeset 107 67f48e288102
parent 79 43ac75054d5c
equal deleted inserted replaced
106:0690d715385d 107:67f48e288102
       
     1 ## special overrides...
       
     2 <%def name="paginate_left()">
       
     3 
       
     4 </%def>
       
     5 
     1 <%def name="paginate(url, count, page_cur, page_max, _more=None, _last=False, **args)">
     6 <%def name="paginate(url, count, page_cur, page_max, _more=None, _last=False, **args)">
     2     <%doc>
     7     <%doc>
     3         Pagination works using page numbers, with a specific number of maximum pages displayed. If _more is True,
     8         Pagination works using page numbers, with a specific number of maximum pages displayed. If _more is True,
     4         then instead of a "Next" button, we have a "More" button, which goes to the max+1'th page, unless _last is
     9         then instead of a "Next" button, we have a "More" button, which goes to the max+1'th page, unless _last is
     5         True, whereupon it's not displayed
    10         True, whereupon it's not displayed.
       
    11 
       
    12         Can be called using <%call>, whereupon caller.left/caller.right can define additional data to display at the
       
    13         left/right of the pagination ul.
     6     </%doc>
    14     </%doc>
     7     <div class="paginate">
    15     <div class="paginate">
     8         <ul>
    16         <ul>
       
    17         % if caller and caller.right :
       
    18             <li class="paginate-right">
       
    19                 ${caller.right()}
       
    20             </li>
       
    21         % endif
       
    22         % if caller and caller.left :
       
    23             <li class="paginate-left">
       
    24                 ${caller.left()}
       
    25             </li>
       
    26         % endif
     9             <li>
    27             <li>
    10             % if page_cur > 1 :
    28             % if page_cur > 1 :
    11                 <a href="${h.build_url(url, count=count, page=page_cur-1, max=max, **args)}">&laquo; Prev</a>
    29                 <a href="${h.build_url(url, count=count, page=page_cur-1, max=max, **args)}">&laquo; Prev</a>
    12             % else :
    30             % else :
    13                 <span>&laquo; Prev</span>
    31                 <span>&laquo; Prev</span>