summaryrefslogtreecommitdiff
path: root/templates/page.jinja
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2013-04-15 00:30:25 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2013-04-15 00:30:25 +0200
commit58165e7f9c72f03604c54f2929b785fc39f760a5 (patch)
tree8ecff9c6dc18f4032ba9fbe8d4f4437c48b546d8 /templates/page.jinja
parent9fb5ed666cf428ae24ddcb1d5a306660526162be (diff)
downloadkosten-58165e7f9c72f03604c54f2929b785fc39f760a5.tar.gz
kosten-58165e7f9c72f03604c54f2929b785fc39f760a5.tar.bz2
kosten-58165e7f9c72f03604c54f2929b785fc39f760a5.zip
Make a 'render_form' macro
Diffstat (limited to '')
-rw-r--r--templates/page.jinja10
1 files changed, 10 insertions, 0 deletions
diff --git a/templates/page.jinja b/templates/page.jinja
index 671f3b2..c09dcde 100644
--- a/templates/page.jinja
+++ b/templates/page.jinja
@@ -25,3 +25,13 @@
<{{tag}} style="{{style}}">{{caller()}}</{{tag}}>
{% endif %}
{% endmacro %}
+
+{% macro render_form(form) %}
+ <table>
+ {% for field in form if not field is hidden %}
+ <tr><th>{{ field.label }}</th><td>{{ field }}</td><td>{{ field.description }}</td>
+ <td>{% if field.errors %}<span class="error">{{ field.errors[0] }}</span>{% endif %}</td></tr>
+ {% endfor %}
+ </table>
+ {{ form.hidden_tag() }}
+{% endmacro %}