added much of the ruler application
[yourule] / templates / gallery.tmpl
diff --git a/templates/gallery.tmpl b/templates/gallery.tmpl
new file mode 100644 (file)
index 0000000..b615ef5
--- /dev/null
@@ -0,0 +1,47 @@
+#extends site
+
+#block body
+
+<h2>Gallery of Existing Rulers</h2>
+
+<table>
+<tr>
+<th>Model</th>
+<th>Pixel Width</th>
+<th>Width (cm/in)</th>
+<th>Rulers</th>
+<th></th>
+</tr>
+#for $ruler in $rulers
+<tr>
+  <td>$ruler.model</td>
+  <td>$ruler.pixel_width</td>
+  <td>$ruler.cm_width()/$ruler.in_width</td>
+  <td>
+    <a href="/show/ruler_${ruler.pixel_width}px_${ruler.cm_width}centimeters.png?fromgallery=true">cm</a>
+    <a href="/show/ruler_${ruler.pixel_width}px_${ruler.in_width}inches.png?fromgallery=true">in</a>
+  </td>
+  <td><form method="GET" action="delete/$ruler.id" style="display:inline;">
+      <input type="submit" value="delete" /></form></td>
+</tr>
+#end for
+</table>
+
+<h2>Add Your Ruler</h2>
+
+<p>If your ruler is not on the list you should add it with the box
+form.</p>
+
+
+<form method="POST" action="/gallery">
+
+#include 'templates/_form_elements.tmpl'
+
+<p><label for="model">Laptop or monitor model:</label>
+<input type="text" name="model" size="50" maxlength="100"
+value="$getVar("model", None)" /></p>
+
+<input type="Submit" name="submit" value="Save" />
+</form>
+
+#end block body

Benjamin Mako Hill || Want to submit a patch?