summaryrefslogtreecommitdiff
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
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
-rw-r--r--templates/pages/add.jinja8
2 files changed, 11 insertions, 7 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 %}
diff --git a/templates/pages/add.jinja b/templates/pages/add.jinja
index 3e3caa2..4728e99 100644
--- a/templates/pages/add.jinja
+++ b/templates/pages/add.jinja
@@ -17,13 +17,7 @@
{% block content %}
<form name="add_expense" method="post">
- <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() }}
+ {{ render_form(form) }}
{% block form_buttons %}
<input type="submit" name="changeB">
{% endblock %}
'>+2 2020-05-10Release v0.2.0v0.2.0René 'Necoro' Neumann2-2/+6 2020-05-10Fix building cacheRené 'Necoro' Neumann1-1/+3 2020-05-10Update READMERené 'Necoro' Neumann1-5/+44 2020-05-10Ignore 'dist' folder and build productsRené 'Necoro' Neumann1-0/+2 2020-05-08Print item hashes in debug modeRené 'Necoro' Neumann1-1/+7 2020-05-07Improve html renderingRené 'Necoro' Neumann2-53/+32 2020-05-07Do not assume items to be new when their published date is newer than the las...René 'Necoro' Neumann2-7/+1 2020-05-07Updating some depsRené 'Necoro' Neumann2-2/+7 2020-05-07Better detection if a text starts with html or notRené 'Necoro' Neumann2-4/+13 2020-05-07go fmtRené 'Necoro' Neumann1-3/+2 2020-05-07Add header X-Feed2Imap-GUIDRené 'Necoro' Neumann3-1/+7 2020-05-07update changelogRené 'Necoro' Neumann1-0/+1 2020-05-07FixRené 'Necoro' Neumann1-1/+1 2020-05-07Unified publishedDate and updatedDate into one (just as the old feed2imap...)René 'Necoro' Neumann5-21/+32 2020-05-06Print version during startupRené 'Necoro' Neumann1-1/+1 2020-05-06Improve templateRené 'Necoro' Neumann3-20/+28 2020-05-05Fix pipelineRené 'Necoro' Neumann1-2/+5 2020-05-05Make changelog a part of the release pipeline (untested)René 'Necoro' Neumann2-0/+12 href='/others/pass.git/commit/src/password-store.sh?h=master&id=20081b546f371dcaee9ea2769f46e513bb39c275&follow=1'>Bump version1.7Jason A. Donenfeld1-1/+1 2017-02-26Modernize makefileJason A. Donenfeld2-31/+36 2017-02-25CopyrightJason A. Donenfeld1-1/+1 2017-02-25StyleJason A. Donenfeld1-2/+2 2017-02-25git: use inner-most directoryJason A. Donenfeld2-27/+48 2017-02-25clip: sleep may require argv[0] to be sleepJason A. Donenfeld1-1/+1 2017-02-25man: document system extensionsJason A. Donenfeld1-2/+3