Fix radio

This commit is contained in:
Melvin Laplanche
2013-08-24 16:12:26 +02:00
parent aeedb1c8a1
commit f62b0d8be7
2 changed files with 14 additions and 14 deletions

View File

@@ -23,24 +23,24 @@
<label class="control-label {{ classes.label }}">{{ field.label }}</label> <label class="control-label {{ classes.label }}">{{ field.label }}</label>
<div class="{{ classes.value }}"> <div class="{{ classes.value }}">
<div class="radio"> {% for choice in field %}
{% for choice in field %} <div class="radio">
<label class="radio"> <label>
{{ choice.tag }} {{ choice.tag }}
{{ choice.choice_label }} {{ choice.choice_label }}
</label> </label>
{% endfor %} </div>
{% endfor %}
{% for error in field.errors %} {% for error in field.errors %}
<span class="help-block">{{ error }}</span> <span class="help-block">{{ 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> </div>
{% else %} {% else %}

View File

@@ -48,7 +48,7 @@ def bootstrap_horizontal(element, label_cols={}):
def add_input_classes(field): def add_input_classes(field):
if not is_checkbox(field) and not is_multiple_checkbox(field): if not is_checkbox(field) and not is_multiple_checkbox(field) and not is_radio(field):
field_classes = field.field.widget.attrs.get('class', '') field_classes = field.field.widget.attrs.get('class', '')
field_classes += ' form-control' field_classes += ' form-control'
field.field.widget.attrs['class'] = field_classes field.field.widget.attrs['class'] = field_classes