Files
deb-python-django-bootstrap…/bootstrapform/templates/bootstrapform/form.html
tzangms 5518ac1c2e move error message on top of help text
according to twitter bootstrap, error message should be inline
2011-11-22 00:45:39 +08:00

51 lines
1.4 KiB
HTML

{% load bootstrap %}
{{ 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>
<div class="input">
<label>
{{ field }} <span>{{ field.label }}</span>
</label>
{% for error in field.errors %}
<span class="help-inline">{{ error }}</span>
{% endfor %}
{% if field.help_text %}
<span class="help-block">
{{ field.help_text }}
</span>
{% endif %}
</div>
</li>
</ul>
{% else %}
{{ field.label_tag }}
<div class="input">
{{ field }}
{% for error in field.errors %}
<span class="help-inline">{{ error }}</span>
{% endfor %}
{% if field.help_text %}
<span class="help-block">
{{ field.help_text }}
</span>
{% endif %}
</div>
{% endif %}
</div>
{% endfor %}