<div data-formindex="{{ index }}" data-formid="{{ formid }}" class="py-2 ts-forms-formwrapper {% if submitmanually %}submitmanually{% endif %} {{ form_css }} {% if is_multiform and multiform_orientation == 'next' %}d-flex align-items-stretch{% endif %}">
    {% if is_multiform and multiform_orientation == "above" %}
        <div class="w-100 d-flex justify-content-end mt-2">
            {% if multiform_ordering %}
                <button type="button" {% if saveOnceDisable %}disabled{% endif %} class="btn btn-secondary ts-forms-multiform-ordering-up {% if index == 0 %} d-none {% endif %}" title="Element nach oben verschieben"><i class="fas fa-arrow-up"></i></button>
                <button type="button" {% if saveOnceDisable %}disabled{% endif %} class="btn btn-secondary ts-forms-multiform-ordering-down {% if index == groups|length-1 %} d-none {% endif %}" title="Element nach unten verschieben"><i class="fas fa-arrow-down"></i></button>
            {% endif %}
            <button type="button" class="btn btn-danger ts-forms-deletemultiform {% if (groups|length == 1) or saveOnceDisable %} disabled {% endif %}" {% if (groups|length == 1) or saveOnceDisable %} disabled {% endif %}><i class="fas fa-trash-alt"></i></button>
        </div>
    {% endif %}
    {% for field in formfields %}
        {% if field.type == "input" %}
            {% include "forms/form-input.html" %}
        {% elseif field.type == "textarea" %}
            {% include "forms/form-textarea.html" %}
        {% elseif field.type == "select" %}
            {% include "forms/form-select.html" %}
        {% elseif field.type == "radio" %}
            {% include "forms/form-radio.html" %}
        {% elseif field.type == "checkbox" %}
            {% include "forms/form-checkbox.html" %}
        {% elseif field.type == "slider" %}
            {% include "forms/form-slider.html" %}
        {% elseif field.type == "text" %}
            {% include "forms/form-text.html" %}
        {% elseif field.type == "scale" %}
            {% include "forms/form-scale.html" %}
        {% elseif field.type == "matrix" %}
            {% include "forms/form-matrix.html" %}
        {% elseif field.type == "upload" %}
            {% include "forms/form-upload.html" %}
        {% elseif field.type == "captcha" %}
            {% include "forms/form-captcha.html" %}
        {% endif %}
    {% endfor %}
    {% if is_multiform and multiform_orientation == "next" %}
        <div class="d-flex align-items-end justify-content-end mb-3" style="width: 106px;">
            {% if multiform_ordering %}
                <button type="button" {% if saveOnceDisable %}disabled{% endif %} class="btn btn-secondary ts-forms-multiform-ordering-up {% if index == 0 %} d-none {% endif %}" title="Element nach oben verschieben"><i class="fas fa-arrow-up"></i></button>
                <button type="button" {% if saveOnceDisable %}disabled{% endif %} class="btn btn-secondary ts-forms-multiform-ordering-down {% if index == groups|length-1 %} d-none {% endif %}" title="Element nach unten verschieben"><i class="fas fa-arrow-down"></i></button>
            {% endif %}
            <button type="button" class="btn btn-danger ts-forms-deletemultiform {% if (groups|length == 1) or saveOnceDisable %} disabled {% endif %}" {% if (groups|length == 1) or saveOnceDisable %} disabled {% endif %}><i class="fas fa-trash-alt"></i></button>
        </div>
    {% endif %}
    {% if submitmanually and not is_multiform %}
        <button type="button" class="btn btn-primary mx-1 mb-3 ts-forms-submitmanually" style="height: fit-content;" 
            data-tsformsidentifier=".ts-forms-element-{{formid}}" data-tsformslink="{{submitmanuallylink}}"
            {% if preview %}
                disabled
            {% endif %}
            >Absenden</button>
    {% endif %}
</div>