diff options
author | Marian Sigler <m@qjym.de> | 2012-09-14 01:28:02 +0200 |
---|---|---|
committer | Marian Sigler <m@qjym.de> | 2012-09-14 01:28:02 +0200 |
commit | 97f983b73c5a27cd8785575bf941e66d747cdd82 (patch) | |
tree | 80385aed31b864836c97f64db9c01d31f4f1e4d2 /templates/_macros.html | |
parent | d7e62d1166991c0c4c9fa1385ead2bd2058b5b86 (diff) | |
download | web-97f983b73c5a27cd8785575bf941e66d747cdd82.tar.gz web-97f983b73c5a27cd8785575bf941e66d747cdd82.tar.bz2 web-97f983b73c5a27cd8785575bf941e66d747cdd82.zip |
first web stuff
Diffstat (limited to 'templates/_macros.html')
-rw-r--r-- | templates/_macros.html | 16 |
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 %} |