<commit_before>{% form_theme form '@DarvinAdmin/fields.html.twig' %}

{% trans_default_domain 'admin' %}

{% if is_widget is not defined %}

    {% set is_widget = false %}

{% endif %}

{% set default_tab = 'form.tabs.default' %}
{% set tabs        = [] %}

{% for row in form %}

    {% set tab = row.vars.admin_tab|default(default_tab) %}

    {% if tab not in tabs %}

        {% set tabs = tabs|merge([tab]) %}

    {% endif %}
{% endfor %}

{{ form_start(form, {'attr': {'class': 'js-form', 'data-target': '.js-form-container', 'data-reload-page': 1}}) }}
<div style="display: none;">
    {% for row in form|filter(row => row.vars.block_prefixes[1] == 'submit') %}
        {{ form_row(row) }}
    {% endfor %}
</div>

{% if tabs|length > 1 %}
    {% if is_widget %}
        <p class="h2">{{ (meta.baseTranslationPrefix ~ 'action.new.title')|trans }}</p>
    {% endif %}
    {{ form_errors(form) }}
    <div class="content-tabs">
        <div class="content-tabs__container tabs js-tabs">
            <div class="tabs__nav">
                {% for tab in tabs %}
                    <div class="tabs__nav-item">{{ tab|trans }}</div>
                {% endfor %}
            </div>
            <div class="tabs__content">
                {% for tab in tabs %}
                    <div class="tabs__content-item">
                        <div class="form-product-show">
                            {% for row in form|filter(row => not row.rendered and row.vars.admin_tab|default(default_tab) == tab) %}
                                {{ form_row(row) }}
                            {% endfor %}
                        </div>
                    </div>
                {% endfor %}
            </div>
        </div>
    </div>
    {% if is_widget %}

        {% include '@DarvinAdmin/crud/_buttons.html.twig' with {'style': 'header', 'entity': null} %}

    {% endif %}
{% else %}
    <div class="content-block">

        {% if is_widget %}
            <div class="content-block__header">
                <p class="h2">{{ (meta.baseTranslationPrefix ~ 'action.new.title')|trans }}</p>
            </div>
        {% endif %}

        <div class="content-block__content">
            <div class="form-product-show">
                {{ form_errors(form) }}
                {{ form_widget(form) }}
            </div>
            {% if is_widget %}

                {% include '@DarvinAdmin/crud/_buttons.html.twig' with {'style': 'header', 'entity': null} %}

            {% endif %}
        </div>
    </div>
{% endif %}
<commit_msg>Remove redundant form_errors() call from CRUD form template.<commit_after>{% form_theme form '@DarvinAdmin/fields.html.twig' %}

{% trans_default_domain 'admin' %}

{% if is_widget is not defined %}

    {% set is_widget = false %}

{% endif %}

{% set default_tab = 'form.tabs.default' %}
{% set tabs        = [] %}

{% for row in form %}

    {% set tab = row.vars.admin_tab|default(default_tab) %}

    {% if tab not in tabs %}

        {% set tabs = tabs|merge([tab]) %}

    {% endif %}
{% endfor %}

{{ form_start(form, {'attr': {'class': 'js-form', 'data-target': '.js-form-container', 'data-reload-page': 1}}) }}
<div style="display: none;">
    {% for row in form|filter(row => row.vars.block_prefixes[1] == 'submit') %}
        {{ form_row(row) }}
    {% endfor %}
</div>

{% if tabs|length > 1 %}
    {% if is_widget %}
        <p class="h2">{{ (meta.baseTranslationPrefix ~ 'action.new.title')|trans }}</p>
    {% endif %}
    {{ form_errors(form) }}
    <div class="content-tabs">
        <div class="content-tabs__container tabs js-tabs">
            <div class="tabs__nav">
                {% for tab in tabs %}
                    <div class="tabs__nav-item">{{ tab|trans }}</div>
                {% endfor %}
            </div>
            <div class="tabs__content">
                {% for tab in tabs %}
                    <div class="tabs__content-item">
                        <div class="form-product-show">
                            {% for row in form|filter(row => not row.rendered and row.vars.admin_tab|default(default_tab) == tab) %}
                                {{ form_row(row) }}
                            {% endfor %}
                        </div>
                    </div>
                {% endfor %}
            </div>
        </div>
    </div>
    {% if is_widget %}

        {% include '@DarvinAdmin/crud/_buttons.html.twig' with {'style': 'header', 'entity': null} %}

    {% endif %}
{% else %}
    <div class="content-block">

        {% if is_widget %}
            <div class="content-block__header">
                <p class="h2">{{ (meta.baseTranslationPrefix ~ 'action.new.title')|trans }}</p>
            </div>
        {% endif %}

        <div class="content-block__content">
            <div class="form-product-show">
                {{ form_widget(form) }}
            </div>
            {% if is_widget %}

                {% include '@DarvinAdmin/crud/_buttons.html.twig' with {'style': 'header', 'entity': null} %}

            {% endif %}
        </div>
    </div>
{% endif %}

{'fraction_non_alphanumeric': 0.1787192118226601, 'fraction_numerical': 0.0019704433497536944, 'mean_word_length': 1.7798466593647317, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 65, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3293979', 'n_tokens_mistral': 1713, 'n_tokens_neox': 1483, 'n_words': 322}