projects
/
yourule
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
moved templating system to jinja
[yourule]
/
templates
/
gallery.tmpl
diff --git
a/templates/gallery.tmpl
b/templates/gallery.tmpl
index b615ef54ed941f82a5bbbd6b061f13442a2ca453..b80b538d89571e2b7e74dbd2e00dd3e7d6cf2b96 100644
(file)
--- a/
templates/gallery.tmpl
+++ b/
templates/gallery.tmpl
@@
-1,10
+1,10
@@
-#extends site
+<% extends 'site.tmpl' %>
-#block body
+<% block body %>
<h2>Gallery of Existing Rulers</h2>
<h2>Gallery of Existing Rulers</h2>
-<table>
+<table
id="gallery"
>
<tr>
<th>Model</th>
<th>Pixel Width</th>
<tr>
<th>Model</th>
<th>Pixel Width</th>
@@
-12,19
+12,18
@@
<th>Rulers</th>
<th></th>
</tr>
<th>Rulers</th>
<th></th>
</tr>
-#for $ruler in $rulers
+<% for ruler in rulers %>
<tr>
<tr>
- <td>
$ruler.model
</td>
- <td>
$ruler.pixel_width
</td>
- <td>
$ruler.cm_width()/$ruler.in_width
</td>
+ <td>
<%= ruler.model%>
</td>
+ <td>
<%= ruler.pixel_width %>
</td>
+ <td>
<%= ruler.cm_width() %>/<%= ruler.in_width() %>
</td>
<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>
+ <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>
- <td><form method="GET" action="delete/
$ruler.id
" style="display:inline;">
+ <td><form method="GET" action="delete/
<%= ruler.id %>
" style="display:inline;">
<input type="submit" value="delete" /></form></td>
</tr>
<input type="submit" value="delete" /></form></td>
</tr>
-#end for
+<% endfor %>
</table>
<h2>Add Your Ruler</h2>
</table>
<h2>Add Your Ruler</h2>
@@
-32,16
+31,21
@@
<p>If your ruler is not on the list you should add it with the box
form.</p>
<p>If your ruler is not on the list you should add it with the box
form.</p>
-
+<% if errormsg %>
+<div class="errormsg">
+<strong>Error</strong><br />
+<%= errormsg %>
+</div>
+<% endif %>
<form method="POST" action="/gallery">
<form method="POST" action="/gallery">
-#include 'templates/_form_elements.tmpl'
+<% include '_form_elements.tmpl' %>
<p><label for="model">Laptop or monitor model:</label>
<input type="text" name="model" size="50" maxlength="100"
<p><label for="model">Laptop or monitor model:</label>
<input type="text" name="model" size="50" maxlength="100"
-value="
$getVar("model", None)
" /></p>
+value="
<%= model %>
" /></p>
<input type="Submit" name="submit" value="Save" />
</form>
<input type="Submit" name="submit" value="Save" />
</form>
-#end block body
+<% endblock %>
Benjamin Mako Hill
||
Want to submit a patch?