summaryrefslogtreecommitdiffstats
path: root/templates/_macros.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/_macros.html')
-rw-r--r--templates/_macros.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/templates/_macros.html b/templates/_macros.html
new file mode 100644
index 0000000..2c933be
--- /dev/null
+++ b/templates/_macros.html
@@ -0,0 +1,16 @@
+{% macro render_field(field) %}
+ <dt>{{ field.label }}
+ <dd>{{ field(**kwargs)|safe }}
+ {% if field.errors|length == 1 %}
+ <div class="errors">
+ {{ field.errors.0 }}
+ </div>
+ {% elif field.errors %}
+ <ul class="errors">
+ {% for error in field.errors %}
+ <li>{{ error }}</li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+ </dd>
+{% endmacro %}