templates/channel_search.tmpl
changeset 76 cc3ab2c39ded
parent 75 c5ce145fdd70
child 79 43ac75054d5c
equal deleted inserted replaced
75:c5ce145fdd70 76:cc3ab2c39ded
     1 <%inherit file="channel.tmpl" />
     1 <%inherit file="channel.tmpl" />
     2 
     2 <%namespace file="inc_paginate.tmpl" import="paginate" />
     3 <%def name="paginate(url, count, page_cur, page_max, _more=None, _last=False, **args)">
       
     4     <%doc>
       
     5         Pagination works using page numbers, with a specific number of maximum pages displayed. If _more is True,
       
     6         then instead of a "Next" button, we have a "More" button, which goes to the max+1'th page, unless _last is
       
     7         True, whereupon it's not displayed
       
     8     </%doc>
       
     9     <div class="paginate">
       
    10         <ul>
       
    11             <li>
       
    12             % if page_cur > 1 :
       
    13                 <a href="${h.build_url(url, count=count, page=page_cur-1, max=max, **args)}">&laquo; Prev</a>
       
    14             % else :
       
    15                 <span>&laquo; Prev</span>
       
    16             %endif
       
    17             </li>
       
    18         % for page in xrange(1, page_max + 1) :
       
    19             <li>
       
    20             % if page == page_cur :
       
    21                 <strong>${page}</strong>
       
    22             % else :
       
    23                 <a href="${h.build_url(url, count=count, page=page, max=page_max, **args)}">${page}</a>
       
    24             % endif
       
    25             </li>
       
    26         % endfor
       
    27             <li>
       
    28             % if _more and _last :
       
    29                 <span>More &raquo;</span>
       
    30             % elif _more : 
       
    31                 <a href="${h.build_url(url, count=count, page=page_max+1, **args)}">More &raquo;</a>
       
    32             % elif page_cur == page_max : ## last page
       
    33                 <span>Next &raquo;</span>
       
    34             % else : 
       
    35                 <a href="${h.build_url(url, count=count, page=page+1, **args)}">Next &raquo;</a>
       
    36             % endif
       
    37             </li>
       
    38         </ul>
       
    39     </div>
       
    40 </%def>
       
    41 
     3 
    42 % if not search_query :
     4 % if not search_query :
    43 <div id="title">${channel.title} :: Search</div>
     5 <div id="title">${channel.title} :: Search</div>
    44 
     6 
    45 <div id="search">
     7 <div id="search">