forked from mrvautin/expressCart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings-discounts.hbs
37 lines (37 loc) · 2.07 KB
/
settings-discounts.hbs
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
{{> partials/menu}}
<main role="main" class="col-md-9 ml-sm-auto col-lg-10 px-4">
<div class="col-md-12">
<h2 class="clearfix">{{ @root.__ "Discount codes" }} <div class="float-right"><a href="/admin/settings/discount/new" class="btn btn-outline-success">{{ @root.__ "New Discount" }}</a></div></h2>
{{#if discounts}}
<ul class="list-group">
{{#each discounts}}
<li class="list-group-item">
<div class="row">
<div class="col-4 mt-2">
<span><strong>{{ @root.__ "Code" }}:</strong> {{this.code}}</span>
</div>
<div class="col-2 mt-2">
<span><strong>{{ @root.__ "Type" }}:</strong> {{this.type}}</span>
</div>
<div class="col-3 mt-2">
<span><strong>{{ @root.__ "Status" }}:</strong>
{{#ifCond (discountExpiry this.start this.end) '===' true}}
<span class="text-success">{{ @root.__ "Running" }}</span>
{{else}}
<span class="text-danger">{{ @root.__ "Not running" }}</span>
{{/ifCond}}
</span>
</div>
<div class="col-3 text-right">
<a class="btn btn-outline-success" href="/admin/settings/discount/edit/{{this._id}}">{{ @root.__ "Edit" }}</a>
<button class="btn btn-outline-danger" id="btnDiscountDelete" data-id="{{this._id}}">{{ @root.__ "Delete" }}</button>
</div>
</div>
</li>
{{/each}}
</ul>
{{else}}
<h4 class="text-warning text-center">{{ @root.__ "There are currently no discount codes setup." }}</h4>
{{/if}}
</div>
</main>