Not showing the div.help-block when there is no help text

This commit is contained in:
tzangms
2011-11-22 00:36:59 +08:00
parent 600770191a
commit cb87f07096

View File

@@ -15,9 +15,13 @@
<label> <label>
{{ field }} <span>{{ field.label }}</span> {{ field }} <span>{{ field.label }}</span>
</label> </label>
{% if field.help_text %}
<span class="help-block"> <span class="help-block">
{{ field.help_text }} {{ field.help_text }}
</span> </span>
{% endif %}
{% for error in field.errors %} {% for error in field.errors %}
<span class="help-inline">{{ error }}</span> <span class="help-inline">{{ error }}</span>
{% endfor %} {% endfor %}
@@ -28,14 +32,16 @@
{{ field.label_tag }} {{ field.label_tag }}
<div class="input"> <div class="input">
{{ field }} {{ field }}
{% if field.help_text %}
<span class="help-block"> <span class="help-block">
{{ field.help_text }} {{ field.help_text }}
</span> </span>
{% if field.errors %} {% endif %}
{% for error in field.errors %} {% for error in field.errors %}
<span class="help-inline">{{ error }}</span> <span class="help-inline">{{ error }}</span>
{% endfor %} {% endfor %}
{% endif %}
</div> </div>
{% endif %} {% endif %}
</div> </div>