{% load bootstrapped_goodies_tags %}
<style>
    form label {
        font-size: 1.3rem !important;
    }
    .controls.col-md-9,
    .controls.col-md-9 * {
        font-size: 1.3rem !important;
    }
</style>
<fieldset class="panel panel-default" id="fieldset-{% if stacked_prefix %}{{ stacked_prefix }}-{% endif %}{{ forloop.counter }}" style="background:transparent">
    {% if fieldset.name %}
        <div class="panel-heading">
            {% if 'collapse' in fieldset.classes %}
                <a data-toggle="collapse" data-target="#fieldset-{% if stacked_prefix %}{{ stacked_prefix }}-{% endif %}{{ forloop.counter }} .fields">
                    {{ fieldset.name }}
                    &nbsp;<span class="btn btn-xs btn-default"><span class="glyphicon glyphglyphicon glyphicon-resize-full"></i></span>
                </a>
            {% else %}
                <strong>{{ fieldset.name }}</strong>
            {% endif %}
        </div>
    {% else %}
        <div class="panel-heading">
            <strong>{{ opts.verbose_name_plural|capfirst }}</strong>
        </div>
    {% endif %}
    <div class="panel-body">
        {% if fieldset.description %}
            <div class="description">{{ fieldset.description|safe }}</div>
        {% endif %}
        {% for line in fieldset %}
            <div class="row">
                <div class="control-group {% if line.fields|length_is:'1' and line.errors %} error{% endif %}{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not line.has_visible_field %} hidden{% endif %}{% endfor %}">
                    {% for field in line %}
                        <div class="col-md-12 form-group {% if not line.fields|length_is:'1' %} field-box{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if field.field.is_hidden %} hidden{% endif %}{% endif %}">
                            <div class="control-label col-md-3">
                                {{ field.label_tag }}
                            </div>
                            {% if field.is_checkbox %}
                                <div class="controls col-md-9">
                                    <div class="checkbox">
                                        {% dab_field_rendering field.field %} {% if field.field.help_text %}<br><span class="help-block">{{ field.field.help_text|safe }}</span>{% endif %}
                                    </div>
                                </div>
                            {% else %}
                                <div class="controls col-md-9">
                                    {% if field.is_readonly %}
                                        <p>{{ field.contents }}</p>
                                    {% else %}
                                        {% dab_field_rendering field.field %}
                                    {% endif %}
                                    {% if not field.is_readonly and field.errors %}<span class="text-danger">{{ field.errors|striptags }}</span>{% endif %}
                                    {% if field.field.help_text %}
                                        <span class="help-block">{{ field.field.help_text|safe }}</span>
                                    {% endif %}
                                </div>
                            {% endif %}
                        </div>
                    {% endfor %}
                </div>
            </div>
        {% endfor %}
    </div>
</fieldset>
