-
Notifications
You must be signed in to change notification settings - Fork 79
/
oro_promotion_coupon_form.html.twig
162 lines (135 loc) · 5.46 KB
/
oro_promotion_coupon_form.html.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
{% block __oro_promotion_coupon_form__container_widget %}
{% set options = {
view: 'oropromotion/js/app/views/frontend-coupon-add-view',
entityClass: oro_class_name(entity),
entityId: entity.id,
selectors: {
couponCodeSelector: '[data-role="coupon-code"]',
couponApplySelector: '[data-role="apply-coupon"]',
couponRemoveSelector: '[data-role="remove-coupon"]',
messagesContainer: '.coupon-container'
}
} %}
{% set attr = layout_attr_defaults(attr, {
'~class': 'coupon-container',
'data-page-component-module': 'oroui/js/app/components/view-component',
'~data-page-component-options': options
}) %}
<div {{ block('block_attributes') }}>
{{ block_widget(block) }}
</div>
{% endblock %}
{% block __oro_promotion_coupon_form__widget_container_widget %}
<div class="collapse-view" data-page-component-collapse="{{ { open: opened }|json_encode() }}">
{{ block_widget(block) }}
</div>
{% endblock %}
{% block __oro_promotion_coupon_form__expand_link_widget %}
<div class="collapse-view__trigger hide-on-expand" data-collapse-trigger>
<i class="fa fa-file-text-o"></i> {{ 'oro.frontend.coupon.expand_link.label'|trans }}
</div>
{% endblock %}
{% block __oro_promotion_coupon_form__expandable_container_widget %}
{% set attr = layout_attr_defaults(attr, {
'~class': 'coupon-container__content'
}) %}
<div class="collapse-view__container" data-collapse-container>
<div {{ block('block_attributes') }}>
{{ block_widget(block) }}
</div>
</div>
{% endblock %}
{% block __oro_promotion_coupon_form__widget_header_widget %}
{% set attr = layout_attr_defaults(attr, {
'~class': 'page-title'
}) %}
<h3 {{ block('block_attributes') }}>{{ 'oro.frontend.coupon.widget.header.label'|trans }}</h3>
{% endblock %}
{% block __oro_promotion_coupon_form__form_container_widget %}
{% set attr = layout_attr_defaults(attr, {
'~class': 'coupon-container__form'
}) %}
<div {{ block('block_attributes') }}>
{{ block_widget(block) }}
</div>
{% endblock %}
{% block __oro_promotion_coupon_form__coupon_input_widget %}
{% set attr = layout_attr_defaults(attr, {
'~class': 'coupon-container__input-wrap'
}) %}
<div {{ block('block_attributes') }}>
<input data-role="coupon-code" placeholder="{{ 'oro.frontend.coupon.widget.coupon_input.placeholder'|trans }}" class="input input--full">
</div>
{% endblock %}
{% block __oro_promotion_coupon_form__apply_button_widget %}
{% set attr = layout_attr_defaults(attr, {
'~class': 'btn btn--action',
'data-role': 'apply-coupon'
}) %}
<button {{ block('block_attributes') }}>{{ 'oro.frontend.coupon.widget.apply_button.label'|trans }}</button>
{% endblock %}
{% block __oro_promotion_coupon_form__applied_coupons_list_container_widget %}
<div>
{{ block_widget(block) }}
</div>
{% endblock %}
{% block __oro_promotion_coupon_form__applied_coupons_list_header_widget %}
{% set attr = layout_attr_defaults(attr, {
'~class': 'bold'
}) %}
<h4 {{ block('block_attributes') }}>{{ 'oro.frontend.coupon.widget.applied_coupons_header.label'|trans }}</h4>
{% endblock %}
{% block __oro_promotion_coupon_form__applied_coupons_list_rows_container_widget %}
{% set attr = layout_attr_defaults(attr, {
'~class': ' coupons-list'
}) %}
<ul {{ block('block_attributes') }}>
{% for appliedCoupon in appliedCoupons %}
{% set promotion = appliedCouponsPromotions[appliedCoupon.sourcePromotionId] is defined ? appliedCouponsPromotions[appliedCoupon.sourcePromotionId] : null %}
{% do block|merge_context({
appliedCoupon: appliedCoupon,
promotion: promotion,
parent: block.vars,
loop: loop
}) %}
{{ block('container_widget') }}
{% endfor %}
</ul>
{% endblock %}
{% block __oro_promotion_coupon_form__applied_coupons_list_row_container_widget %}
{% set attr = layout_attr_defaults(attr, {
'~class': 'coupons-list__item'
}) %}
{% if promotion is empty %}
{% set attr = layout_attr_defaults(attr, {
'~class': 'coupons-list__item',
'data-item-can-remove-promotion': ''
}) %}
{% endif %}
<li {{ block('block_attributes') }}>
{{ block_widget(block) }}
</li>
{% endblock %}
{% block __oro_promotion_coupon_form__applied_coupons_list_row_text_container_widget %}
<span>
{{ block_widget(block) }}
</span>
{% endblock %}
{% block __oro_promotion_coupon_form__applied_coupons_list_row_coupon_code_widget %}
<span>{{ appliedCoupon.couponCode }}</span>
{% endblock %}
{% block __oro_promotion_coupon_form__applied_coupons_list_row_promotion_name_widget %}
{% if promotion is not null %}
<span>{{ promotion.labels|localized_value ? promotion.labels|localized_value|oro_html_sanitize : promotion.rule.name }}</span>
{% endif %}
{% endblock %}
{% block __oro_promotion_coupon_form__applied_coupons_list_row_delete_button_widget %}
{% set attr = layout_attr_defaults(attr, {
'class': 'btn btn--plain btn--baseline',
'data-object-id': appliedCoupon.id,
'data-role': 'remove-coupon'
}) %}
<button {{ block('block_attributes') }}>
<i class="fa-trash-o fa--x-large fa--no-offset"></i>
</button>
{% endblock %}