{# 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 not sonata_admin.field_description.hasassociationadmin %} {% for element in value %} {{ element|render_relation_element(sonata_admin.field_description) }} {% endfor %} {% else %}
{% 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['sonata_admin'].admin.trans(nested_field.vars.label) }}
{% endif %} {% elseif form.children|length > 0 %} {% set associationAdmin = sonata_admin.field_description.associationadmin %}
{% for nested_group_field in form.children %}
{% for name, form_group in associationAdmin.formgroups %}
{% for field_name in form_group.fields %} {% set nested_field = nested_group_field.children[field_name] %} {% if associationAdmin.formfielddescriptions[field_name] is defined %} {{ form_row(nested_field, { 'inline': 'natural', 'edit' : 'inline' }) }} {% set dummy = nested_group_field.setrendered %} {% else %} {{ form_row(nested_field) }} {% endif %} {% endfor %}
{% endfor %}
{% if nested_group_field['_delete'] is defined %} {{ form_row(nested_group_field['_delete']) }} {% endif %} {% 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.isGranted('CREATE') and btn_add %} {{ btn_add|trans({}, btn_catalogue) }} {% endif %} {# add code for the sortable options #} {% if sonata_admin.field_description.options.sortable is defined %} {% endif %} {# include association code #} {% include 'SonataDoctrineORMAdminBundle:CRUD:edit_orm_one_association_script.html.twig' %} {% else %} {% if sonata_admin.field_description.associationadmin.hasroute('create') and sonata_admin.field_description.associationadmin.isGranted('CREATE') and btn_add %} {{ btn_add|trans({}, btn_catalogue) }} {% endif %} {% include 'SonataDoctrineORMAdminBundle:CRUD:edit_modal.html.twig' %} {% include 'SonataDoctrineORMAdminBundle:CRUD:edit_orm_many_association_script.html.twig' %} {% endif %}
{% endif %}