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)}">« Prev</a></li>
% else :
<li><span>« 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 »</a></li>
% else :
<li><span>Next »</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>