Added handling of visible/hidden fields (fixes issue where labels/wrapping elements of hidden fields were being rendered). Also added form.non_field_errors to form template.

This commit is contained in:
Matt Austin
2011-09-14 11:39:44 +08:00
parent 38b97b81f6
commit f5ed04d648

View File

@@ -1,7 +1,13 @@
{% load bootstrap %}
{% for field in form %}
<div class="clearfix {% if field.errors %}error{% endif %}">
{{ form.non_field_errors }}
{% for field in form.hidden_fields %}
{{ field }}
{% endfor %}
{% for field in form.visible_fields %}
<div class="clearfix{% if field.errors %} error{% endif %}">
{% if field|is_checkbox %}
<ul class="inputs-list">
<li>
@@ -25,3 +31,4 @@
{% endif %}
</div>
{% endfor %}