{% extends '@OroUI/actions/update.html.twig' %} {% oro_title_set({params : {"%id%": entity.id|default('N/A'|trans)} }) %} {% set formAction = entity.id ? path('oro_payment_methods_configs_rule_update', { 'id': entity.id }) : path('oro_payment_methods_configs_rule_create') %} {% block pageHeader %} {% if entity.id %} {% set breadcrumbs = { 'entity': entity, 'indexPath': path('oro_payment_methods_configs_rule_index'), 'indexLabel': 'oro.payment.paymentmethodsconfigsrule.entity_short_plural_label'|trans, 'entityTitle': entity.rule.name|slice(0, 50) } %} {{ parent() }} {% else %} {% set breadcrumbs = { 'indexLabel': 'Create', 'entityTitle': 'Payment Rule', 'indexPath': path('oro_payment_methods_configs_rule_create') } %} {% set title = 'oro.ui.create_entity'|trans({'%entityName%': 'oro.payment.paymentmethodsconfigsrule.entity_short_label'|trans}) %} {% include '@OroUI/page_title_block.html.twig' with { title: title } %} {% endif %} {% endblock pageHeader %} {% block navButtons %} {% import '@OroUI/macros.html.twig' as UI %} {{ parent() }} {{ UI.cancelButton(path('oro_payment_methods_configs_rule_index')) }} {% if entity.id and is_granted('oro_payment_methods_configs_rule_update') or is_granted('oro_payment_methods_configs_rule_create') %} {% set html = '' %} {% if is_granted('oro_payment_methods_configs_rule_view') %} {% set html = UI.saveAndCloseButton({ 'route': 'oro_payment_methods_configs_rule_view', 'params': {'id': '$id'} }) %} {% endif %} {% set html = html ~ UI.saveAndStayButton({ 'route': 'oro_payment_methods_configs_rule_update', 'params': {'id': '$id'} }) %} {{ UI.dropdownSaveButton({'html': html}) }} {% endif %} {% endblock navButtons %} {% block oro_payment_rule_add_method_widget %}
{{ form_row(form.method, {'attr': {'class': 'oro-payment-rule-add-method-select'}}) }}
{{ form.vars.add_label|default('oro.form.collection.add')|trans }}
{% endblock %} {% block content_data %} {% set id = 'payment-methods-configs-rule-edit' %} {% set dataBlocks = [ { 'title': 'oro.payment.sections.general'|trans, 'class': 'active', 'subblocks': [ { 'data': [ form_row(form.rule.enabled), form_row(form.rule.name), form_row(form.rule.sortOrder), form_row(form.currency), form_row(form.rule.stopProcessing), ] }, ] }, { 'title': 'oro.payment.sections.destination'|trans, 'subblocks': [ { 'data': [ form_widget(form.destinations, {'attr': {'class': 'oro-payment-rule-collection oro-payment-rule-destinations-collection row-oro'}}), ] } ] }, { 'title': 'oro.payment.sections.expression'|trans, 'subblocks': [ { 'data': [ form_row(form.rule.expression), ] } ] }, { 'title': 'oro.payment.sections.configurations'|trans, 'subblocks': [ { 'data': [ form_widget(form.methodConfigs, {'attr': {'class': 'oro-payment-rule-collection oro-payment-rule-method-configs-collection row-oro'}}), form_errors(form.methodConfigs), block('oro_payment_rule_add_method_widget') ] } ] }, ] %} {% set dataBlocks = dataBlocks|merge(oro_form_additional_data(form, 'Additional'|trans)) %} {% set data = { 'formErrors': form_errors(form)|nl2br, 'dataBlocks': dataBlocks } %} {{ parent() }} {% endblock %}