{% extends '@OroUI/actions/update.html.twig' %} {% form_theme form with ['@OroForm/Form/fields.html.twig'] %} {% oro_title_set({params : {'%title%': 'oro.dotmailer.integration.connection.label'|trans} }) %} {% set formAction = path('oro_dotmailer_integration_connection') %} {% block bodyClass %}dotmailer-page{% endblock %} {% block navButtons %}{% endblock navButtons %} {% block pageHeader %} {% set title = 'oro.dotmailer.integration.connection.label'|trans %} {% include '@OroUI/page_title_block.html.twig' with { title: title } %} {% endblock pageHeader %} {% block content_data %} {% import '@OroUI/macros.html.twig' as UI %} {% set button %} {% if entity and entity.transport.clientId and entity.transport.clientKey %} {% if loginUserUrl %}
{{ UI.button({ 'path': path('oro_dotmailer_oauth_disconnect', {'id': entity.id}), 'aCss': 'btn btn-primary', 'label': 'oro.dotmailer.integration.disconnect.label'|trans, 'title': 'oro.dotmailer.integration.disconnect.label'|trans, }) }}
{% else %}
{{ UI.button({ 'path': connectUrl, 'aCss': 'btn btn-primary', 'label': 'oro.dotmailer.integration.connect.label'|trans, 'title': 'oro.dotmailer.integration.connect.label'|trans, }) }}
{% endif %} {% endif %} {% endset %} {% set id = 'oro_dotmailer_integration_connection' %} {% set dataBlocks = {} %} {% if loginUserUrl %} {% set dotmailerSection %} {# fake input to make sure focus is not set on the bottom form dropdown#} {% endset %} {% set dataBlocks = dataBlocks|merge([{ 'title': 'oro.dotmailer.channel_type.label'|trans, 'subblocks': [{ 'title': '', 'data': [ dotmailerSection ] }] }] ) %} {% endif %} {% set dataBlocks = dataBlocks|merge([{ 'title': 'oro.dotmailer.integration.choose_connection.label'|trans, 'subblocks': [{ 'title': '', 'data': [ form_row(form.channel), button ] }] }] ) %} {% set data = { 'formErrors': form_errors(form) ? form_errors(form) : null, 'dataBlocks': dataBlocks } %} {% set fieldsToSendOnChannelChange = [form.channel.vars.full_name] %} {% if form._token is defined %} {% set fieldsToSendOnChannelChange = fieldsToSendOnChannelChange|merge([form._token.vars.full_name]) %} {% endif %} {{ parent() }} {% endblock content_data %}