{% extends 'OroUIBundle:actions:update.html.twig' %}
{% set formAction = entity.id ? path('oro_account_update', {id: entity.id}) : path('oro_account_create') %}
{% oro_title_set({params : {"%accountName%": entity.name|default('N/A'|trans), '%entityName%': 'oro.account.entity_label'|trans} }) %}
{% block navButtons %}
    {{ parent() }}
    {{ UI.cancelButton(path('oro_account_index')) }}
    {% set html = UI.saveAndCloseButton() %}
    {% if entity.id or resource_granted('oro_account_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_index'),
            'indexLabel': 'oro.account.entity_plural_label'|trans,
            'entityTitle': entity.name|default('N/A'|trans)
        } %}
        {{ parent() }}
    {% else %}
        {% set title = 'oro.ui.create_entity'|trans({'%entityName%': 'oro.account.entity_label'|trans}) %}
        {% include 'OroUIBundle::page_title_block.html.twig' with { title: title } %}
    {% endif %}
{% endblock pageHeader %}
{% block content_data %}
    {% set id = 'account-edit' %}
    {% set dataBlocks = [
        {
            'title': 'oro.account.sections.general'|trans,
            'class': 'active',
            'subblocks': [
                {
                    'data': [
                        form_row(form.name),
                        form_row(form.group),
                        form_row(form.parent),
                        form_row(form.internal_rating),
                        form_row(form.salesRepresentatives),
                    ]
                },
                {
                    'title': 'oro.account.sections.addresses'|trans,
                    'data': [
                        form_widget(form.addresses),
                    ]
                },
            ]
        }
    ] %}
    {% set data = {
        'formErrors': form_errors(form),
        'dataBlocks': dataBlocks
    }%}
    {{ parent() }}
{% endblock content_data %}