-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoupon-list.html
284 lines (236 loc) · 13.7 KB
/
coupon-list.html
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
{extends file="admin-layout.tpl"}
{block name="no-return-functions"}
{$admin_current_location = 'tools'}
{/block}
{block name="check-resource"}admin.coupon{/block}
{block name="check-access"}view{/block}
{block name="page-title"}{intl l='Coupons'}{/block}
{block name="main-content"}
{$coupon_page = {$smarty.get.page|default:1}}
<div class="coupons">
<div id="wrapper" class="container">
<nav>
<ul class="breadcrumb">
<li><a href="{url path='admin/home'}">{intl l='Home'}</a></li>
<li><a href="{url path='admin/tools'}">{intl l='Tools'}</a></li>
<li><a href="{url path='admin/coupon'}">{intl l='Coupons'}</a></li>
</ul>
</nav>
{hook name="coupon.top" location="coupon_top" }
<div class="row">
<div class="col-md-12">
<div class="general-block-decorator">
<div class="table-responsive">
<table class="table table-striped table-condensed" id="folder_list">
<caption>
{intl l='Coupons'}
{hook name="coupon.list-caption" location="coupon_list_caption" }
{loop type="auth" name="can_create" role="ADMIN" resource="admin.coupon" access="CREATE"}
<a class="btn btn-primary action-btn" title="{intl l='Create a new coupon'}" href="{url path='/admin/coupon/create'}">
<span class="glyphicon glyphicon-plus-sign"></span>
</a>
{/loop}
</caption>
<thead>
<tr>
<th>{admin_sortable_header
current_order=$coupon_order
order='code'
reverse_order='code-reverse'
path={url path='/admin/coupon'}
request_parameter_name='coupon_order'
label="{intl l='Code'}"
}
</th>
<th>{admin_sortable_header
current_order=$coupon_order
order='title'
reverse_order='title-reverse'
path={url path='/admin/coupon'}
request_parameter_name='coupon_order'
label="{intl l='Title'}"
}
</th>
<th class="text-center">{admin_sortable_header
current_order=$coupon_order
order='enabled'
reverse_order='enabled-reverse'
path={url path='/admin/coupon'}
request_parameter_name='coupon_order'
label="{intl l='Status'}"
}
</th>
<th class="text-center">{admin_sortable_header
current_order=$coupon_order
order='start-date'
reverse_order='start-date-reverse'
path={url path='/admin/coupon'}
request_parameter_name='coupon_order'
label="{intl l='Start Date'}"
}
</th>
<th class="text-center">{admin_sortable_header
current_order=$coupon_order
order='expiration-date'
reverse_order='expiration-date-reverse'
path={url path='/admin/coupon'}
request_parameter_name='coupon_order'
label="{intl l='Expiration date'}"
}
</th>
<th class="text-center">{admin_sortable_header
current_order=$coupon_order
order='days-left'
reverse_order='days-left-reverse'
path={url path='/admin/coupon'}
request_parameter_name='coupon_order'
label="{intl l='Days before expiration'}"
}
</th>
<th class="text-center">{admin_sortable_header
current_order=$coupon_order
order='usages-left'
reverse_order='usages-left-reverse'
path={url path='/admin/coupon'}
request_parameter_name='coupon_order'
label="{intl l='Usages left'}"
}
</th>
{hook name="coupon.table-header" location="coupon_table_header" }
<th>{intl l="Actions"}</th>
</tr>
</thead>
<tbody>
{loop type="coupon" name="list_coupon" page={$coupon_page} limit={config key="number_default_results_per_page.coupon_list" default=20} order={$coupon_order|default:'code'} backend_context="true"}
<tr>
<td>
{loop type="auth" name="can_change" role="ADMIN" resource="admin.coupon" access="UPDATE"}
<a title="{intl l='Change this coupon'}" href="{url path="/admin/coupon/update/%id" id=$ID}">{$CODE}</a>
{/loop}
{elseloop rel="can_change"}
{$CODE}
{/elseloop}
</td>
<td>{$TITLE}</td>
<td class="text-center">
{if $IS_ENABLED}
<span class="label label-success">{intl l="Enabled"}</span>
{else}
<span class="label label-default">{intl l="Disabled"}</span>
{/if}
</td>
<td class="text-center">
{if $START_DATE == null}
/
{else}
{format_date date=$START_DATE output="date"}
{/if}
</td>
<td class="text-center">{format_date date=$EXPIRATION_DATE output="date"}</td>
<td class="text-center">
{if $DAY_LEFT_BEFORE_EXPIRATION <= 0}
<span class="label label-default">{intl l='Expired'}</span>
{else}
{$DAY_LEFT_BEFORE_EXPIRATION}
{/if}
</td>
<td class="text-center">
{if $USAGE_LEFT == -1}
{intl l="Unlimited"}
{elseif $USAGE_LEFT}
{$USAGE_LEFT}
{else}
<span class="label label-default">0</span>
{/if}
</td>
{hook name="coupon.table-row" location="coupon_table_row" coupon_id={$ID} }
<td class="actions">
<div class="btn-toolbar btn toolbar-primary">
<span class="glyphicon glyphicon-cog"></span>
</div>
<div class="toolbar-options hidden">
{loop type="auth" name="can_change" role="ADMIN" resource="admin.coupon" access="UPDATE"}
<a title="{intl l='Change this coupon'}" href="{url path="/admin/coupon/update/%id" id=$ID}"><span class="glyphicon glyphicon-edit"></span></a>
{/loop}
{loop type="auth" name="can_delete" role="ADMIN" resource="admin.coupon" access="DELETE"}
<a title="{intl l='Delete this coupon'}" class="delete_coupon_btn" href="#delete_coupon" data-target="#delete_coupon" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
{/loop}
</div>
</td>
</tr>
{/loop}
{elseloop rel="list_coupon"}
<tr>
<td colspan="100">
<div class="alert alert-info text-center">
<p>{intl l="No coupon is currently defined. Please use the (+) button above to create your first coupon."}</p>
</div>
</td>
</tr>
{/elseloop}
</tbody>
{ifloop rel="list_coupon"}
<tfoot>
<tr>
<td colspan="100">
{include
file = "includes/pagination.html"
loop_ref = "list_coupon"
max_page_count = 10
page_url = {url path="/admin/coupon" orders_order=$coupon_order}
}
</td>
</tr>
</tfoot>
{/ifloop}
</table>
</div>
</div>
{hook name="coupon.bottom" location="coupon_bottom" }
</div>
</div>
</div> <!-- #wrapper -->
{* DELETE MODAL *}
{capture "delete_dialog"}
<input type="hidden" name="coupon_id" id="coupon_delete_id" value="" />
{hook name="coupon.delete-form" }
{/capture}
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "delete_coupon"
dialog_title = {intl l="Delete coupon"}
dialog_message = {intl l="Do you really want to delete this coupon ?"}
form_action = {token_url path='/admin/coupon/delete'}
form_content = {$smarty.capture.delete_dialog nofilter}
}
</div>
{/block}
{block name="javascript-initialization"}
{javascripts file='assets/js/bootstrap-editable/bootstrap-editable.js'}
<script src="{$asset_url}"></script>
{/javascripts}
{javascripts file='assets/js/tablesorter/jquery.tablesorter.min.js'}
<script src="{$asset_url}"></script>
{/javascripts}
{javascripts file='assets/js/tablesorter/jquery.metadata.js'}
<script src="{$asset_url}"></script>
{/javascripts}
{javascripts file='assets/js/tablesorter/jquery.tablesorter.widgets.js'}
<script src="{$asset_url}"></script>
{/javascripts}
{javascripts file='assets/js/tablesorter/jquery.tablesorter.widgets-filter-formatter.js'}
<script src="{$asset_url}"></script>
{/javascripts}
<script>
$(document).ready(function() {
$(".delete_coupon_btn").click(function() {
$("#coupon_delete_id").val($(this).data("id"));
});
});
</script>
{/block}
{block name="javascript-last-call"}
{hook name="coupon.list-js" location="coupon-list-js" }
{/block}