{% extends '@OroUI/actions/update.html.twig' %} {% import '@OroDataGrid/macros.html.twig' as dataGrid %} {% form_theme form with '@OroForm/Form/fields.html.twig' %} {% set formAction = entity.id ? path('oro_customer_customer_group_update', {id: entity.id}) : path('oro_customer_customer_group_create') %} {% oro_title_set({params : {"%customerGroupName%": entity.name|default('N/A'|trans), '%entityName%': 'oro.customer.customergroup.entity_label'|trans} }) %} {% if entity.id %} {% set gridName = 'customer-group-customers-grid-update' %} {% else %} {% set gridName = 'customer-group-customers-grid-create' %} {% endif %} {% block navButtons %} {% import '@OroUI/macros.html.twig' as UI %} {% placeholder update_navButtons with {entity: entity} %} {{ UI.cancelButton(path('oro_customer_customer_group_index')) }} {% set html = UI.saveAndCloseButton() %} {% set html = '' %} {% if is_granted('oro_customer_customer_group_view') %} {% set html = html ~ UI.saveAndCloseButton({ 'route' : 'oro_customer_customer_group_view', 'params' : {'id': '$id'} }) %} {% endif %} {% if is_granted('oro_customer_customer_group_update') %} {% set html = html ~ UI.saveAndStayButton({ 'route' : 'oro_customer_customer_group_update', 'params': {'id': '$id'} }) %} {% endif %} {{ UI.dropdownSaveButton({'html': html}) }} {% endblock %} {% block pageHeader %} {% if entity.id %} {% set breadcrumbs = { 'entity': entity, 'indexPath': path('oro_customer_customer_group_index'), 'indexLabel': 'oro.customer.customergroup.entity_plural_label'|trans, 'entityTitle': entity.name|default('N/A'|trans) } %} {{ parent() }} {% else %} {% set title = 'oro.ui.create_entity'|trans({'%entityName%': 'oro.customer.customergroup.entity_label'|trans}) %} {% include '@OroUI/page_title_block.html.twig' with { title: title } %} {% endif %} {% endblock pageHeader %} {% block content_data %} {% set id = 'customer-group-edit' %} {% set dataBlocks = [ { 'title': 'oro.customer.sections.general'|trans, 'subblocks': [ { 'data': [ form_row(form.name) ] } ] } ] %} {% set dataBlocks = dataBlocks|merge(oro_form_additional_data(form, 'oro.order.sections.additional'|trans)) %} {% set dataBlocks = dataBlocks|merge([{ 'title' : 'oro.customer.sections.customergroup.customers'|trans, 'subblocks': [{ 'title' : null, 'useSpan': false, 'data' : [ form_widget(form.appendCustomers, {'id': 'groupAppendCustomers'}), form_widget(form.removeCustomers, {'id': 'groupRemoveCustomers'}), dataGrid.renderGrid(gridName, {group: entity.id}, { cssClass: 'inner-grid' }) ] }] }] ) %} {% set data = { 'formErrors': form_errors(form), 'dataBlocks': dataBlocks }%}