{# 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. #} {% extends base_template %} {% block title %} {% if admin.id(object) %} {{ "title_edit"|trans({'%name%': admin.toString(object) }, 'SonataAdminBundle') }} {% else %} {{ "title_create"|trans({}, 'SonataAdminBundle') }} {% endif %} {% endblock%} {% block actions %}
{% endblock %} {% block side_menu %}{{ knp_menu_render(admin.sidemenu(action), {}, 'list') }}{% endblock %} {% block form %} {% set url = admin.id(object) ? 'edit' : 'create' %} {% if not admin.hasRoute(url)%}
{{ "form_not_available"|trans({}, "SonataAdminBundle") }}
{% else %}
{% if form.vars.errors|length > 0 %}
{{ form_errors(form) }}
{% endif %} {% block sonata_pre_fieldsets %}{% endblock %} {% for name, form_group in admin.formgroups %}
{% if form_group.collapsed %} {{ name|trans({}, admin.translationdomain) }} {% else %} {{ name|trans({}, admin.translationdomain) }} {% endif %}
{% for field_name in form_group.fields %} {% if admin.formfielddescriptions[field_name] is defined %} {{ form_row(form[field_name])}} {% endif %} {% endfor %}
{% endfor %} {% block sonata_post_fieldsets %}{% endblock %} {{ form_rest(form) }}
{% if app.request.isxmlhttprequest %} {% if admin.id(object) %} {% else %} {% endif %} {% else %} {% if admin.id(object) %} {% if admin.hasroute('delete') and admin.isGranted('DELETE', object) %} {% trans from 'SonataAdminBundle' %}delete_or{% endtrans %} {% trans from 'SonataAdminBundle' %}link_delete{% endtrans %} {% endif %} {% else %} {% endif %} {% endif %}
{% endif%} {% endblock %}