{% extends '@OroUI/actions/update.html.twig' %} {% import '@OroUI/macros.html.twig' as UI %} {% set formAction = entity.id ? path('oro_promotion_coupon_update', {id: entity.id}) : path('oro_promotion_coupon_create') %} {% oro_title_set({params : {"%code%": entity.code, "%entityName%": 'oro.promotion.coupon.entity_label'|trans}}) %} {% block navButtons %} {% import '@OroUI/macros.html.twig' as UI %} {{ parent() }} {{ UI.cancelButton(path('oro_promotion_coupon_index')) }} {% set html = UI.saveAndCloseButton({ 'route': 'oro_promotion_coupon_index' }) %} {% if entity.id or is_granted('oro_promotion_coupon_update') %} {% set html = html ~ UI.saveAndStayButton({ 'route' : 'oro_promotion_coupon_update', 'params' : {'id': '$id'} }) %} {% endif %} {{ UI.dropdownSaveButton({'html': html}) }} {% endblock navButtons %} {% block pageHeader %} {% if entity.id %} {% set breadcrumbs = { 'entity': entity, 'indexPath': path('oro_promotion_coupon_index'), 'indexLabel': 'oro.promotion.coupon.entity_plural_label'|trans, 'entityTitle': entity.code|default('N/A'|trans) } %} {{ parent() }} {% else %} {% set title = 'oro.ui.create_entity'|trans({'%entityName%': 'oro.promotion.coupon.entity_label'|trans}) %} {% include '@OroUI/page_title_block.html.twig' with { title: title } %} {% endif %} {% endblock pageHeader %} {% block content_data %} {% set id = 'coupon-edit' %} {% set dataBlocks = [ { 'title': 'oro.promotion.coupon.sections.general'|trans, 'subblocks': [ { 'data': [ form_row(form.code), form_row(form.promotion), form_row(form.enabled), form_row(form.usesPerCoupon), form_row(form.usesPerPerson), form_row(form.validFrom), form_row(form.validUntil) ] } ] } ] %} {% set dataBlocks = dataBlocks|merge(oro_form_additional_data(form, 'oro.promotion.coupon.sections.additional'|trans)) %} {% set data = { 'formErrors': form_errors(form), 'dataBlocks': dataBlocks }%}
{{ parent() }}
{% endblock content_data %}