{% set isWidgetContext = isWidgetContext is defined ? isWidgetContext : false %} {% extends isWidgetContext ? '@OroForm/Layout/widgetForm.html.twig' : bap.layout %} {% import '@OroSync/Include/contentTags.html.twig' as syncMacro %} {% import '@OroUI/macros.html.twig' as UI %} {% set entity = entity is defined ? entity : null %} {% block before_content_addition %} {% placeholder update_before_content_addition with {entity: entity} %} {% endblock before_content_addition %} {% block content %} {% import '@OroUI/macros.html.twig' as UI %} {% if isWidgetContext and savedId is defined and savedId %} {% block widget_context %}
{% endblock widget_context %} {% else %} {% set formAction = formAction|default() %} {% if addQueryParameters is not defined or addQueryParameters == true %} {% set formAction = oro_url_add_query(formAction) %} {% endif %} {% set formAttr = formAttr|default({})|merge({ 'id': form.vars.id, 'data-collect': 'true' }) %} {% for key,value in formAttr %} {% if value is iterable %} {% set formAttr = formAttr|merge({(key): value|json_encode}) %} {% endif %} {% endfor %} {% if pageComponent is defined %} {% for key,value in pageComponent %} {% if key == 'layout' %} {% set formAttr = formAttr|merge({'data-layout': pageComponent.layout}) %} {% elseif value is iterable %} {% set formAttr = formAttr|merge({('data-page-component-' ~ key): value|json_encode}) %} {% else %} {% set formAttr = formAttr|merge({('data-page-component-' ~ key): value}) %} {% endif %} {% endfor %} {% endif %} {{ form_start(form, {'action': formAction, 'attr': formAttr}) }} {% if isWidgetContext %} {% block page_widget_actions %}
{% endblock page_widget_actions %} {% else %}
{% set titleButtonsBlock %} {% placeholder update_navButtons_before with {entity: entity} %} {% block navButtons %}{% placeholder update_navButtons with {entity: entity} %}{% endblock navButtons %} {% placeholder update_navButtons_after with {entity: entity} %} {% if form.vars.method != 'GET' %} {% set inputAction = form.vars.default_input_action is defined ? form.vars.default_input_action : '' %} {% endif %} {% endset %} {% set pageActionsBlock %} {% block pageActions %} {% placeholder update_pageActions_before with {entity: entity} %} {% set audit_entity_id = audit_entity_id is defined ? audit_entity_id : form.vars.value.id|default %} {% if audit_entity_id %} {% placeholder change_history_block with { 'entity': entity|default(form.vars.value), 'entity_class': audit_entity_class|default(null), 'id': audit_entity_id, 'title': audit_title|default(form.vars.value.__toString is defined ? form.vars.value.__toString : null), 'audit_path': audit_path|default('oro_dataaudit_history'), 'audit_show_change_history': audit_show_change_history|default(false) } %} {% endif %} {% placeholder update_pageActions_after with {entity: entity} %} {% endblock pageActions %} {% endset %}
{% endif %}
{% block content_data %} {% set data = oro_form_process_with_page_identifier(data, form, entity, id) %} {% if entity and data is defined and data.dataBlocks is defined %} {% set dataBlocks = data.dataBlocks %} {%- set activitiesData -%} {% placeholder update_content_data_activities with {entity: entity} %} {%- endset -%} {% if activitiesData is not empty %} {% set dataBlocks = dataBlocks|merge([{ 'title': 'oro.activity.sections.activities'|trans, 'subblocks': [ { 'spanClass': 'empty', 'data': [activitiesData] } ] }]) %} {% endif %} {%- set communicationsData -%} {% placeholder update_content_data_communications with {entity: entity} %} {%- endset -%} {% if communicationsData is not empty %} {% set dataBlocks = dataBlocks|merge([{ 'title': 'Communications'|trans, 'subblocks': [ { 'spanClass': 'empty', 'data': [communicationsData] } ] }]) %} {% endif %} {%- set additionalInformationData -%} {% placeholder update_content_data_additional_information with {entity: entity} %} {%- endset -%} {% if additionalInformationData is not empty %} {% set dataBlocks = dataBlocks|merge([{ 'title': 'Additional Information'|trans, 'subblocks': [ { 'spanClass': 'empty', 'data': [additionalInformationData] } ] }]) %} {% endif %} {%- set commentsData -%} {% placeholder update_content_data_comments with {entity: entity} %} {%- endset -%} {% if commentsData is not empty %} {% set dataBlocks = dataBlocks|merge([{ 'title': 'oro.comment.entity_plural_label'|trans, 'subblocks': [ { 'spanClass': 'responsive-cell activity-list-widget', 'data': [commentsData] } ] }]) %} {% endif %} {% set data = data|merge({'dataBlocks': dataBlocks}) %} {% endif %} {{ UI.scrollData(id, data, entity, form) }} {% endblock content_data %}
{% block sync_content_tags %} {# block added just for possibility to disable it in child templates if needed #} {{ syncMacro.syncContentTags(form.vars.value) }} {% endblock %} {{ form_end(form, {'render_rest': false}) }} {{ oro_form_js_validation(form) }} {% endif %} {% endblock content %}