Remove fieldset from sub form template were causing some widgets to span the entire width of the screen.

This commit is contained in:
Roberto Rosario
2015-03-31 04:31:16 -04:00
parent 3e488d2ccf
commit 2237a5b378

View File

@@ -40,41 +40,38 @@
{% for field in form.hidden_fields %}
{{ field }}
{% endfor %}
<fieldset>
{% for field in form.visible_fields %}
<div class="form-group {% if field.errors %}has-error{% endif %}">
{% for field in form.visible_fields %}
<div class="form-group {% if field.errors %}has-error{% endif %}">
{# We display the label then the field for all except checkboxes #}
{% if field|widget_type != 'checkboxinput' %}
{% if not hide_labels %}{{ field.label_tag }}{% if field.field.required and not read_only and not form_hide_required_text %} ({% trans 'required' %}){% endif %}{% endif %}
{% endif %}
{# We display the label then the field for all except checkboxes #}
{% if field|widget_type != 'checkboxinput' %}
{% if not hide_labels %}{{ field.label_tag }}{% if field.field.required and not read_only and not form_hide_required_text %} ({% trans 'required' %}){% endif %}{% endif %}
{% endif %}
{% if field|widget_type == 'checkboxinput' %}
<div class="checkbox">
<label>
<input {% if field.value %}checked="checked"{% endif %} name="{{ field.name }}" type="checkbox">
{% if not hide_labels %}{{ field.label }}{% if field.field.required and not read_only and not form_hide_required_text %} ({% trans 'required' %}){% endif %}{% endif %}
</label>
</div>
{% elif field|widget_type == 'detailselectmultiple' %}
{% if read_only %}
<input class="form-control" readonly="readonly" type="text" value="{{ field|get_choice_value }}">
{% else %}
{% render_field field class+="form-control" %}
{% endif %}
{% elif field|widget_type == 'clearablefileinput' %}
{# Don't add 'form-control' class to filebrowse fields #}
{% if field.errors %}
{% render_field field class+="form-control" %}
{% else %}
{% render_field field class+="" %}
{% endif %}
{% if field|widget_type == 'checkboxinput' %}
<div class="checkbox">
<label>
<input {% if field.value %}checked="checked"{% endif %} name="{{ field.name }}" type="checkbox">
{% if not hide_labels %}{{ field.label }}{% if field.field.required and not read_only and not form_hide_required_text %} ({% trans 'required' %}){% endif %}{% endif %}
</label>
</div>
{% elif field|widget_type == 'detailselectmultiple' %}
{% if read_only %}
<input class="form-control" readonly="readonly" type="text" value="{{ field|get_choice_value }}">
{% else %}
{% render_field field class+="form-control" %}
{% endif %}
{% if field.help_text %}<p class="help-block">{{ field.help_text }}</p>{% endif %}
</div>
{% endfor %}
</fieldset>
{% elif field|widget_type == 'clearablefileinput' %}
{# Don't add 'form-control' class to filebrowse fields #}
{% if field.errors %}
{% render_field field class+="form-control" %}
{% else %}
{% render_field field class+="" %}
{% endif %}
{% else %}
{% render_field field class+="form-control" %}
{% endif %}
{% if field.help_text %}<p class="help-block">{{ field.help_text }}</p>{% endif %}
</div>
{% endfor %}
{% endif %}