{% extends 'OroUIBundle:actions:update.html.twig' %}
{% import 'OroDataGridBundle::macros.html.twig' as dataGrid %}
{% form_theme form with 'OroFormBundle:Form:fields.html.twig' %}
{% set formAction = entity.id ? path('oro_account_group_update', {id: entity.id}) : path('oro_account_group_create') %}
{% oro_title_set({params : {"%accountGroupName%": entity.name|default('N/A'|trans), '%entityName%': 'oro.account.accountgroup.entity_label'|trans} }) %}
{% set gridName = 'account-group-accounts-grid-update' %}
{% block navButtons %}
{% if entity.id and resource_granted('DELETE', entity) %}
{{ UI.deleteButton({
'dataUrl': path('oro_api_account_delete_account_group', {'id': entity.id}),
'dataRedirect': path('oro_account_group_index'),
'aCss': 'no-hash remove-button',
'dataId': entity.id,
'id': 'btn-remove-attribute',
'entity_label': 'oro.account.accountgroup.entity_label'|trans,
}) }}
{{ UI.buttonSeparator() }}
{% endif %}
{{ UI.cancelButton(path('oro_account_group_index')) }}
{% set html = UI.saveAndCloseButton() %}
{% if entity.id or resource_granted('oro_account_group_update') %}
{% set html = html ~ UI.saveAndStayButton() %}
{% endif %}
{{ UI.dropdownSaveButton({'html': html}) }}
{% endblock %}
{% block pageHeader %}
{% if entity.id %}
{% set breadcrumbs = {
'entity': entity,
'indexPath': path('oro_account_group_index'),
'indexLabel': 'oro.account.accountgroup.entity_plural_label'|trans,
'entityTitle': entity.name|default('N/A'|trans)
} %}
{{ parent() }}
{% else %}
{% set title = 'oro.ui.create_entity'|trans({'%entityName%': 'oro.account.accountgroup.entity_label'|trans}) %}
{% include 'OroUIBundle::page_title_block.html.twig' with { title: title } %}
{% endif %}
{% endblock pageHeader %}
{% block content_data %}
{% set id = 'account-group-edit' %}
{% set dataBlocks = [
{
'title': 'oro.account.sections.general'|trans,
'class': 'active',
'subblocks': [
{
'data': [
form_row(form.name)
]
}
]
}
] %}
{% set dataBlocks = dataBlocks|merge([{
'title' : 'oro.account.sections.accountgroup.accounts'|trans,
'subblocks': [{
'title' : null,
'useSpan': false,
'data' : [
form_widget(form.appendAccounts, {'id': 'groupAppendAccounts'}),
form_widget(form.removeAccounts, {'id': 'groupRemoveAccounts'}),
dataGrid.renderGrid(gridName, {group: entity.id}, { cssClass: 'inner-grid' })
]
}]
}] ) %}
{% set data = {
'formErrors': form_errors(form),
'dataBlocks': dataBlocks
}%}
{{ parent() }}
{% endblock content_data %}