# HG changeset patch # User Daniele Nicolodi # Date 1313935285 -7200 # Node ID 4bc420e70b510c8eb37f8464b05f0d147adcb24d # Parent 06cf88d1e44588da8451fd758fe7543fa0ad27c5 Cleanup forms rendering. diff -r 06cf88d1e445 -r 4bc420e70b51 src/ltpdarepo/templates/forms.html --- a/src/ltpdarepo/templates/forms.html Sun Aug 21 16:01:01 2011 +0200 +++ b/src/ltpdarepo/templates/forms.html Sun Aug 21 16:01:25 2011 +0200 @@ -19,22 +19,16 @@ {% if field.type in ('HiddenField', 'SubmitField') %} {{ field }} {% else %} - {% if field.errors %} -
- {% else %} -
- {% endif %} - {{ field.label }} {% if field.flags.required %}*{% endif %} - {% if field.errors %} -
    - {% for error in field.errors %} -
  • {{ error }}
  • - {% endfor %} -
- {% endif %} + {% set cssclass = 'field' %} + {% if field.flags.required %}{% set cssclass = cssclass + ' required' %}{% endif %} +
+ {{ field.label }} {% if field.description %}
{{ field.description }}
{% endif %} + {% if field.errors %} + {{ ' '.join(field.errors) }} + {% endif %}
{{ field }}
{% endif %}