templates/gallery.html
author terom
Sat, 22 Dec 2007 21:31:01 +0000
changeset 18 46536daf9e04
parent 12 c2d8e9a754a1
child 19 8d3ffd87cb0b
permissions -rw-r--r--
fix bug with shorturls in gallery.html, and some horrible, horrible crap for the CGI stuff - I need to drop everything now and take a fresh look tomorrow before it gets even worse
<%inherit file="master.html" /> <!-- %> -->

<%def name="pagination(num_pages, cur_page)"> <!-- %> -->
% if num_pages > 1 :
        <ul>
        
%   if cur_page > 0 :
            <li><a href="${h.url_for_page(cur_page - 1)}">&laquo; Prev</a></li>
%   else :
            <li><span>&laquo; Prev</span></li>
%   endif

%   for page in xrange(0, num_pages) :
%     if page == cur_page :
            <li><strong>${page + 1}</strong></li>
%     else :
            <li><a href="${h.url_for_page(page)}">${page + 1}</a></li>
%     endif            
%   endfor

%   if cur_page < num_pages - 1 :
            <li><a href="${h.url_for_page(cur_page + 1)}">Next &raquo;</a></li>
%   else :
            <li><span>Next &raquo;</span></li>
%   endif
        </ul>
% endif       
</%def> <!-- %> -->

    <h1>${title}</h1>
    <div id="dirs">
% if dirs :
        <ul>
%   for dir in dirs :
            <li><a href="${dir.name}">${dir.title}</a></li>
%   endfor
        </ul>
% endif
    </div>
    <div class="paginate">
${pagination(num_pages, cur_page)}
    </div>
    <div id="thumbnails">
% for img in images :
        ${h.tag_for_img(img.html_name, img.thumb_name)}
% endfor
    </div>
    <div class="paginate">
${pagination(num_pages, cur_page)}
    </div>
    <p id="description">
${description}
    </p>
    <div id="info">
        <p>ShortURL: <a href="${shorturl}" rel="nofollow">${shorturl_code}</a></p>
    </div>