{% extends 'OroUIBundle:actions:view.html.twig' %}
{% import 'OroDataGridBundle::macros.html.twig' as dataGrid %}
{% oro_title_set({params : {"%title%": entity.name } }) %}
{% set gridName = 'account-group-accounts-grid-view' %}
{% block pageHeader %}
{% 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() }}
{% endblock pageHeader %}
{% block navButtons %}
{{ parent() }}
{% if 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,
}) }}
{% endif %}
{% endblock navButtons %}
{% block content_data %}
{% set accountGroupInfo %}
{{ oro_widget_render({
'widgetType': 'block',
'url': path('oro_account_group_info', {id: entity.id}),
'alias': 'account-group-info-widget'
}) }}
{% endset %}
{% set accountsGrid = dataGrid.renderGrid(gridName, {group: entity.id}, { cssClass: 'inner-grid' }) %}
{% set dataBlocks = [
{
'title': 'oro.account.sections.general'|trans,
'class': 'active',
'subblocks': [{'data' : [accountGroupInfo]}]
},
{
'title': 'oro.account.sections.accountgroup.accounts'|trans,
'subblocks': [{'data' : [accountsGrid]}]
}
] %}
{% set id = 'account-group-view' %}
{% set data = {'dataBlocks': dataBlocks} %}
{{ parent() }}
{% endblock content_data %}
{% block stats %}
{# Must be empty, because parent view uses this block to render dates, which are not implemented in this entity #}
{% endblock stats %}