{# This file is part of the Sonata package. (c) Thomas Rabaix For the full copyright and license information, please view the LICENSE file that was distributed with this source code. #} {% if sonata_admin.field_description.hasassociationadmin %}
{% if sonata_admin.edit == 'inline' %} {% if sonata_admin.inline == 'table' %} {% if form.children|length > 0 %} {% for field_name, nested_field in (form.children|first).children %} {% if field_name == '_delete' %} {% else %} {% endif %} {% endfor %} {% for nested_group_field_name, nested_group_field in form.children %} {% for field_name, nested_field in nested_group_field.children %} {% endfor %} {% endfor %}
{{ 'action_delete'|trans({}, 'SonataAdminBundle') }} {{ nested_field.vars.label|trans({}, nested_field.vars['sonata_admin'].admin.translationDomain) }}
{% if sonata_admin.field_description.associationadmin.hasformfielddescriptions(field_name) is defined %} {{ form_widget(nested_field) }} {% set dummy = nested_group_field.setrendered %} {% else %} {{ form_widget(nested_field) }} {% endif %} {% if nested_field.vars.errors|default(false) %}
{{ form_errors(nested_field) }}
{% endif %}
{% endif %} {% elseif form.children|length > 0 %}
{% for nested_group_field_name, nested_group_field in form.children %} {% for field_name, nested_field in nested_group_field.children %} {% if sonata_admin.field_description.associationadmin.hasformfielddescriptions(field_name) is defined %} {{ form_row(nested_field) }} {% set dummy = nested_group_field.setrendered %} {% else %} {% if nested_field.vars.name == '_delete' %} {{ form_row(nested_field, { 'label': ('action_delete'|trans({}, 'SonataAdminBundle')) }) }} {% else %} {{ form_row(nested_field) }} {% endif %} {% endif %} {% endfor %} {% endfor %}
{% endif %} {% else %} {{ form_widget(form) }} {% endif %}
{% if sonata_admin.edit == 'inline' %} {% if sonata_admin.field_description.associationadmin.hasRoute('create') and sonata_admin.field_description.associationadmin.hasAccess('create') and btn_add %} {# NEXT_MAJOR: Remove the fallback on null and on btn_catalogue #} {{ btn_translation_domain|default(null) is same as(false) ? btn_add : btn_add|trans({}, btn_translation_domain|default(btn_catalogue)) }} {% endif %} {# include association code #} {% include '@SonataAdmin/CRUD/Association/edit_one_script.html.twig' %} {% else %} {% if sonata_admin.field_description.associationadmin.hasRoute('create') and sonata_admin.field_description.associationadmin.hasAccess('create') and btn_add %} {# NEXT_MAJOR: Remove the fallback on null and on btn_catalogue #} {{ btn_translation_domain|default(null) is same as(false) ? btn_add : btn_add|trans({}, btn_translation_domain|default(btn_catalogue)) }} {% include '@SonataAdmin/CRUD/Association/edit_modal.html.twig' %} {% include '@SonataAdmin/CRUD/Association/edit_many_script.html.twig' %} {% endif %} {% endif %}
{% endif %}