{% extends app.request.xmlHttpRequest ? 'form.html.twig' : 'base.html.twig' %} {% import "project/actions.html.twig" as actions %} {% block page_title %}{{ 'admin_project.title'|trans }}{% endblock %} {% block page_actions %}{{ actions.project(project, 'edit') }}{% endblock %} {% block main %} {% set formEditTemplate = app.request.xmlHttpRequest ? 'default/_form_modal.html.twig' : 'default/_form.html.twig' %} {% set formOptions = { 'title': (project.id is null ? 'create'|trans : 'edit'|trans({}, 'actions')), 'form': form, 'back': path('admin_project') } %} {% embed formEditTemplate with formOptions %} {% block form_body %}