support radio buttons

This commit is contained in:
James Robert 2013-05-06 16:10:36 -03:00
parent ef89291e81
commit 02743e9e16

View File

@ -1,21 +1,37 @@
{% load bootstrap %} {% load bootstrap %}
<div class="control-group{% if field.errors %} error{% endif %}{% if field.field.required %} required{% endif %}"> <div class="control-group{% if field.errors %} error{% endif %}{% if field.field.required %} required{% endif %}">
{% if field|is_checkbox %} {% if field|is_checkbox %}
<div class="controls"> <div class="controls">
<label class="checkbox"> <label class="checkbox">
{{ field }} <span>{{ field.label }}</span> {{ field }} <span>{{ field.label }}</span>
</label> </label>
{% for error in field.errors %} {% for error in field.errors %}
<span class="help-inline">{{ error }}</span> <span class="help-inline">{{ error }}</span>
{% endfor %} {% endfor %}
{% if field.help_text %} {% if field.help_text %}
<p class="help-block"> <p class="help-block">
{{ field.help_text|safe }} {{ field.help_text|safe }}
</p> </p>
{% endif %} {% endif %}
</div> </div>
{% else %}{% if field|is_radio %}
<div class="controls">
<label class="radio">
{{ field }} <span>{{ field.label }}</span>
</label>
{% for error in field.errors %}
<span class="help-inline">{{ error }}</span>
{% endfor %}
{% if field.help_text %}
<p class="help-block">
{{ field.help_text|safe }}
</p>
{% endif %}
</div>
{% else %} {% else %}
<label class="control-label" for="{{ field.auto_id }}">{{ field.label }}</label> <label class="control-label" for="{{ field.auto_id }}">{{ field.label }}</label>
@ -33,5 +49,5 @@
{% endif %} {% endif %}
</div> </div>
{% endif %} {% endif %}{% endif %}
</div> </div>