templates/gallery.html
changeset 12 c2d8e9a754a1
parent 5 156cdfffef8e
child 18 46536daf9e04
--- a/templates/gallery.html	Thu Dec 20 17:42:04 2007 +0000
+++ b/templates/gallery.html	Fri Dec 21 20:36:03 2007 +0000
@@ -1,25 +1,56 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
-  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<%inherit file="master.html" /> <!-- %> -->
 
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-  <head>
-    <title><!-- TITLE --></title>
-    <link rel="Stylesheet" type="text/css" href="<!-- STYLE_URL -->" />
-  </head>
-  <body>
-    <div id="breadcrumb"><!-- BREADCRUMB --></div>
-    <h1><!-- TITLE --></h1>
-    <div id="dirs"><!-- DIRECTORIES --></div>
-    <div class="paginate"><!-- PAGINATION --></div>
+<%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">
-      <!-- CONTENT -->
+% for img in images :
+        ${h.tag_for_img(img.html_name, img.thumb_name)}
+% endfor
     </div>
-    <div class="paginate"><!-- PAGINATION --></div>
-    <p id="description"><!-- DESCR --></p>
+    <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>
+        <p>ShortURL: <a href="${shorturl}>" rel="nofollow">${shorturl_code}</a></p>
     </div>
-    <p id="about"><a href="http://marttila.de/~terom/degal/">DeGAL</a> <!-- VERSION --></p>
-  </body>
-</html>