<fieldset class="module aligned {{ fieldset.classes }}">
    <div class="card">
        <div class="card-header {{ direction.panel }}">
            {% if fieldset.name %}<h5 class="title">{{ fieldset.name }}</h5>{% endif %}
            {% if fieldset.description %}
                <div class="description">{{ fieldset.description|safe }}</div>
            {% endif %}
        </div>

        <div class="card-body">
            {% for line in fieldset %}
                <div class="row {{ direction.panel }}">
                    <div class="col-md-7">
                        <div class="form-group{% if line.fields|length_is:'1' and line.errors %} errors{% endif %}{% if not line.has_visible_field %} hidden{% endif %}{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
                            {% if line.fields|length_is:'1' %}{{ line.errors }}{% endif %}
                            {% for field in line %}
{#                                <div{% if not line.fields|length_is:'1' %} class="fieldBox{% 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 %}"{% elif field.is_checkbox %} class="checkbox-row"{% endif %}>#}

                                    {% if not line.fields|length_is:'1' and not field.is_readonly %}
                                        {{ field.errors }}
                                    {% endif %}

                                    {% if field.is_checkbox %}
                                        <div class="form-check">
                                            <label class="form-check-label">
                                                {{ field.label_tag }}
                                                {{ field.field }}
                                                <span class="form-check-sign"><span class="check"></span></span>
                                            </label>
                                        </div>
                                    {% else %}
                                        {{ field.label_tag }}

                                        {% if field.is_readonly %}
                                            <div class="readonly">{{ field.contents }}</div>
                                        {% else %}
                                            {{ field.field }} {#<i class="fa fa-plus"></i>#}
                                        {% endif %}
                                    {% endif %}

                                    {% if field.field.help_text %}
                                        <div class="help">{{ field.field.help_text|safe }}</div>
                                    {% endif %}
{#                                </div>#}
                            {% endfor %}
                        </div>
                    </div>
                </div>
            {% endfor %}
        </div>
    </div>
</fieldset>
