{% set element = element ?? null %}
{% set namespace = namespace is defined ? namespace : 'fields' %}

{% namespace namespace %}
    {% for field in fields %}
        {% set translatable = field.getIsTranslatable() %}

        {% if translatable %}
            {% switch field.translationMethod %}
            {% case 'site' %}
                {% set translationDescription = 'This field is translated for each site.'|t('app') %}
            {% case 'siteGroup' %}
                {% set translationDescription = 'This field is translated for each site group.'|t('app') %}
            {% case 'language' %}
                {% set translationDescription = 'This field is translated for each language.'|t('app') %}
            {% endswitch %}
        {% endif %}

        <div class="thin rowHeader">
            <span class="heading-text {% if field.required %}required{% endif %}">
                {{ field.name | t('site') }}

                {% if field.instructions %}
                    <span class="info">{{ field.instructions | t('site') | e | md }}</span>
                {% endif %}

                {% if translatable %}
                    <span class="extralight" data-icon="language" title="{{ translationDescription ?? 'This field is translatable.' | t('app') }}"></span>
                {% endif %}
            </span>
        </div>

        <div class="superTable-layout-row-new-field">
            {% include "super-table/field" with {
                field: field,
                required: field.required,
                element: element,
                static: static ?? false,
                registerDeltas: registerDeltas ?? false,
            } only %}
        </div>

        <div class="blank-spacer"></div>
    {% endfor %}
{% endnamespace %}
