{% extends 'OroUIBundle:actions:update.html.twig' %} {% oro_title_set({params : {"%id%": entity.id|default('N/A'|trans)} }) %} {% set formAction = entity.id ? path('oro_shipping_rule_update', { 'id': entity.id }) : path('oro_shipping_rule_create') %} {% block pageHeader %} {% if entity.id %} {% set breadcrumbs = { 'entity': entity, 'indexPath': path('oro_shipping_rule_index'), 'indexLabel': 'oro.shipping.shippingrule.entity_plural_label'|trans, 'entityTitle': entity.name|slice(0, 50) } %} {{ parent() }} {% else %} {% set breadcrumbs = { 'indexLabel': 'Create', 'entityTitle': 'Shipping Rule', 'indexPath': path('oro_shipping_rule_create') } %} {% set title = 'oro.ui.create_entity'|trans({'%entityName%': 'oro.shipping.shippingrule.entity_label'|trans}) %} {% include 'OroUIBundle::page_title_block.html.twig' with { title: title } %} {% endif %} {% endblock pageHeader %} {% block navButtons %} {{ parent() }} {{ UI.cancelButton(path('oro_shipping_rule_index')) }} {% if entity.id and resource_granted('oro_shipping_rule_update') or resource_granted('oro_shipping_rule_create') %} {% set html = '' %} {% if resource_granted('oro_shipping_rule_view') %} {% set html = UI.saveAndCloseButton({ 'route': 'oro_shipping_rule_view', 'params': {'id': '$id'} }) %} {% endif %} {% set html = html ~ UI.saveAndStayButton({ 'route': 'oro_shipping_rule_update', 'params': {'id': '$id'} }) %} {{ UI.dropdownSaveButton({'html': html}) }} {% endif %} {% endblock navButtons %} {% block oro_shipping_rule_add_method_widget %}
{{ form_row(form.method, {'attr': {'class': 'oro-shipping-rule-add-method-select'}}) }}
{{ form.vars.add_label|default('oro.form.collection.add')|trans }}
{% endblock %} {% block content_data %} {% set id = 'shipping-rule-edit' %} {% set dataBlocks = [ { 'title': 'oro.shipping.sections.general'|trans, 'class': 'active', 'subblocks': [ { 'data': [ form_row(form.enabled), form_row(form.name), form_row(form.priority), form_row(form.currency), form_row(form.stopProcessing), ] }, ] }, { 'title': 'oro.shipping.sections.shippingrule_destination'|trans, 'subblocks': [ { 'data': [ form_widget(form.destinations, {'attr': {'class': 'oro-shipping-rule-collection oro-shipping-rule-destinations-collection row-oro'}}), ] } ] }, { 'title': 'oro.shipping.sections.shippingrule_conditions'|trans, 'subblocks': [ { 'data': [ form_row(form.conditions), ] } ] }, { 'title': 'oro.shipping.sections.shippingrule_configurations'|trans, 'subblocks': [ { 'data': [ form_widget(form.methodConfigs, {'attr': {'class': 'oro-shipping-rule-collection oro-shipping-rule-method-configs-collection row-oro'}}), form_errors(form.methodConfigs), block('oro_shipping_rule_add_method_widget') ] } ] }, ] %} {% set data = { 'formErrors': form_errors(form), 'dataBlocks': dataBlocks } %} {{ parent() }} {% endblock %}