-
Notifications
You must be signed in to change notification settings - Fork 0
/
UnusedCoupons.cshtml
56 lines (45 loc) · 1.66 KB
/
UnusedCoupons.cshtml
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
@using System.Web.Mvc.Ajax
@using System.Web.Mvc.Html
@using Sitecore.Mvc
@using Sitecore.XA.Foundation.MarkupDecorator.Extensions
@using Sitecore.XA.Foundation.SitecoreExtensions.Extensions
@using Feature.LoyaltyPoints.Website.Models
@model LoyaltyCouponsRenderingModel
@*
data-cxa-model references the JavaScript class that will manage knockout.js behavior. This follows the pattern of CXA's OrdersViewModel.
*@
<div @Html.Sxa().Component("cxa-unusedcoupons-component", Model.Attributes)
data-cxa-component-class="UnusedCoupons"
data-cxa-component-initialized="false"
data-cxa-component-model="CouponsViewModel"
data-cxa-component-type="component">
<hr />
@if (!String.IsNullOrWhiteSpace(Model.ErrorMessage))
{
<div class="error-message">
<p>@Model.ErrorMessage</p>
</div>
}
else
{
<div class="component-content">
<div class="unused-components-list">
<table data-bind="visible: coupons().length">
<thead>
<tr>
<th>Coupons</th>
</tr>
</thead>
<tbody data-bind="foreach: coupons">
<tr>
<td data-bind="text: code"></td>
</tr>
</tbody>
</table>
</div>
</div>
}
</div>
@* TODO Figure out the CXA way to register these: *@
<script src="/Scripts/Commerce/Feature/LoyaltyPoints/cxa.feature.coupons.model.js"></script>
<script src="/Scripts/Commerce/Feature/LoyaltyPoints/cxa.feature.unusedcoupons.js"></script>