<div class="form-tabs">

{% if uri.params.tab %}
    {% set active = uri.params.tab %}
{% elseif field.active %}
    {% set active = field.active %}
{% else %}
    {% set active = 1 %}
{% endif %}

{% if field.fields %}
    {% for tab in field.fields %}<input type="radio" name="tab" id="tab{{ loop.index }}" class="tab-head" {{ active == loop.index ? 'checked="checked"' : '' }}/><label for="tab{{ loop.index }}">{% if grav.twig.twig.filters['tu'] is defined %}{{ tab.title|tu }}{% else %}{{ tab.title|t }}{% endif %}</label>{% endfor %}
    <div class="tab-body-wrapper">
        {% for field in field.fields %}
        {% set value = data.value(field.name) %}
        <div id="tab-body-{{ loop.index }}" class="tab-body">
        {% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
        </div>
        {% endfor %}
    </div>
{% endif %}
</div>

