{% extends '@OroUI/actions/view.html.twig' %}
{% import '@OroDataGrid/macros.html.twig' as dataGrid %}
{% oro_title_set({params : {"%title%": entity.name } }) %}
{% set gridName = 'customer-group-customers-grid-view' %}
{% block pageHeader %}
{% 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() }}
{% endblock pageHeader %}
{% block content_data %}
{% set customerGroupInfo %}
{{ oro_widget_render({
'widgetType': 'block',
'url': path('oro_customer_customer_group_info', {id: entity.id}),
'alias': 'customer-group-info-widget'
}) }}
{% endset %}
{% set customersGrid = dataGrid.renderGrid(gridName, {group: entity.id}, { cssClass: 'inner-grid' }) %}
{% import '@OroUI/macros.html.twig' as UI %}
{% set customersDataBlocks = [] %}
{% if is_granted('oro_customer_create') %}
{% set customersDataBlocks = customersDataBlocks|merge([
UI.renderButtonsRow(UI.quickAccessAddButton({
'dataUrl': path('oro_customer_customer_create_for_customer_group', { group: entity.id }),
'title': 'oro.customer.customergroup.quick_access_button.new_customer.label'|trans,
'label': 'oro.customer.customergroup.quick_access_button.new_customer.label'|trans,
'widget': {
'reload-grid-name': gridName,
'options': {
'alias': 'oro_customer_customer_create_for_customer_group_dialog',
'dialogOptions': {
'title': 'oro.customer.customergroup.quick_access_button.create_customer.widget.title'|trans,
}
}
}
}))
]) %}
{% endif %}
{% set dataBlocks = [
{
'title': 'oro.customer.sections.general'|trans,
'subblocks': [{'data' : [customerGroupInfo]}]
},
{
'title': 'oro.customer.sections.customergroup.customers'|trans,
'subblocks': [
{
'data' : customersDataBlocks|merge([
customersGrid
])
}
]
}
] %}
{% set id = 'customer-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 %}