This repository has been archived by the owner on Aug 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
sidebarTemplate.html
110 lines (98 loc) · 3.22 KB
/
sidebarTemplate.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
<div class="column person">
<div class="name"><%- customer.name %></div>
<div><%- customer.email %></div>
<a class="gmail_simple_button" href="<%- customer.dashboardURL %>" target="_blank">
<div role="button" class="J-J5-Ji T-I T-I-ax7 ayk-axZ-aup-I-UR ayk-axZ-aup-I ayk-axZ-aup-at2 T-I-JW T-I-Zf-aw2" style="visibility: visible; -webkit-user-select: none;">
<span class="Txql0d ayk-axZ-aup-I-Jm-UR">View on Stripe</span>
</div>
</a>
</div>
<div class="row">
<div class="column">
<div class="num"><%- formatStripeCurrency(stats.currentMRR, 0) %></div>
<div class="num_description">MRR</div>
</div>
<div class="spacer"></div>
<div class="column">
<div class="num"><%- formatStripeCurrency(stats.totalSpend, 0) %></div>
<div class="num_description">Total</div>
</div>
</div>
<div class="stripe_sidebar_section">
<p class="title">Active Subscriptions</p>
<%
_.each(subscriptions.data, function(sub) {
if (sub.status = "active") {
%>
<div class="row main">
<div class="name"><%- sub.quantity %> x <%- sub.plan.name %></div>
<div class="spacer"></div>
<div class="details">(<%- formatStripeCurrency(sub.discountedPrice, 0) %>/month)</div>
</div>
<div class="row secondary">
<div class="spacer"></div>
<!-- <div class="actions">Edit | Cancel</div> -->
</div>
<% }
});
%>
<div>
<div class="stripe_sidebar_section">
<p class="title">Recent Invoices</p>
<%
_.each(invoices.data, function(inv, i) {
if (i > 4) return;
%>
<div class="row main">
<div class="name"><%- formatStripeCurrency(inv.total, 2) %></div>
<div class="spacer"></div>
<div class="details"><%- new Date(inv.date*1000).toLocaleDateString() %></div>
</div>
<div class="row secondary">
<img class="pay_status" src="<%- inv.imageUrl %>"></img>
<div class="description row"><%- inv.paid ? "Paid" : "Unpaid" %></div>
<div class="spacer"></div>
<!-- <div class="actions">Refund</div> -->
</div>
<%
});
%>
</div>
<div class="stripe_sidebar_section">
<p class="title">Recent Charges</p>
<%
_.each(charges.data, function(chg, i) {
if (i > 4) return;
%>
<div class="row main">
<div class="name"><%- formatStripeCurrency(chg.amount, 2) %></div>
<div class="spacer"></div>
<div class="details"><%- new Date(chg.created*1000).toLocaleDateString() %></div>
</div>
<div class="row secondary">
<img class="pay_status" src="<%- chg.imageUrl %>"></img>
<div class="description row"><%- chg.status == "succeeded" ? "Charged" : "Failed" %></div>
<div class="spacer"></div>
</div>
<%
});
%>
</div>
<div class="stripe_sidebar_section">
<p class="title">Cards</p>
<%
if (!customer.sources.data) {
return;
}
_.each(customer.sources.data, function(source) {
%>
<div class="row main">
<img class="card" src="<%- source.imageUrl %>"></img>
<div class="name row">**** **** **** <%- source.last4 %></div>
<div class="spacer"></div>
<div class="details"><%- source.exp_month %>/<%- source.exp_year %></div>
</div>
<%
});
%>
</div>