{% extends '@OroUI/actions/view.html.twig' %} {% oro_title_set({params : {"%code%": entity.code}}) %} {% block pageHeader %} {% set breadcrumbs = { 'entity': entity, 'indexPath': path('oro_promotion_coupon_index'), 'indexLabel': 'oro.promotion.coupon.entity_plural_label'|trans, 'entityTitle': entity.code } %} {{ parent() }} {% endblock pageHeader %} {% block breadcrumbs %} {% import '@OroUI/macros.html.twig' as UI %} {{ parent() }} {% if entity.enabled %} {{ UI.badge('oro.promotion.coupon.enabled.active'|trans, 'enabled') }} {% else %} {{ UI.badge('oro.promotion.coupon.enabled.inactive'|trans, 'disabled') }} {% endif %} {% endblock breadcrumbs %} {% block content_data %} {% import '@OroUI/macros.html.twig' as UI %} {% if entity.promotion %} {% set promotion = UI.entityViewLink(entity.promotion, entity.promotion.rule.name|trans, 'oro_promotion_view') %} {% endif %} {% set dataBlocks = { 'general': { 'title': 'oro.promotion.coupon.sections.general'|trans, 'subblocks': [ { 'data' : { 'code': UI.renderProperty('oro.promotion.coupon.code.label'|trans, entity.code, null, null, {'dir': 'ltr'}), 'promotion': UI.renderHtmlProperty('oro.promotion.coupon.promotion.label'|trans, promotion|default('N/A'|trans)), 'usesPerCoupon': UI.renderProperty('oro.promotion.coupon.uses_per_coupon.label'|trans, entity.usesPerCoupon), 'usesPerPerson': UI.renderProperty('oro.promotion.coupon.uses_per_person.label'|trans, entity.usesPerPerson), 'validFrom': UI.renderProperty('oro.promotion.coupon.valid_from.label'|trans, entity.validFrom|oro_format_datetime), 'validUntil': UI.renderProperty('oro.promotion.coupon.valid_until.label'|trans, entity.validUntil|oro_format_datetime), } }, ] } } %} {% set id = 'coupon-view' %} {% set data = {'dataBlocks': dataBlocks} %} {{ parent() }} {% endblock content_data %}