mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 10:06:08 -05:00
5c40221ab2
Using invoices to aggregate totals which should provide a more accurate growth rate.
103 lines
3 KiB
Text
103 lines
3 KiB
Text
extends /templates/base
|
|
|
|
block content
|
|
|
|
if !me.isAdmin()
|
|
div You must be logged in as an admin to view this page.
|
|
else
|
|
|
|
if total === 0
|
|
h4 Fetching dashboard data...
|
|
else
|
|
.container-fluid
|
|
.row
|
|
.col-md-5.big-stat.total-count
|
|
div.description Total
|
|
div.count= total
|
|
.col-md-5.big-stat.remaining-count
|
|
div.description Remaining
|
|
div.count= total - cancelled
|
|
.col-md-5.big-stat.cancelled-count
|
|
div.description Cancelled
|
|
div.count= cancelled
|
|
.col-md-5.big-stat.growth-rate
|
|
div.description 30 Day Total Growth
|
|
div.count #{monthlyGrowth.toFixed(1)}%
|
|
.col-md-5.big-stat.churn-count
|
|
div.description Monthly Churn
|
|
div.count #{monthlyChurn.toFixed(1)}%
|
|
|
|
each graph in analytics.graphs
|
|
.line-graph-container
|
|
each line in graph.lines
|
|
each point in line.points
|
|
.graph-point-info-container(data-pointid="#{point.pointID}")
|
|
div(style='font-weight:bold;') #{point.day}
|
|
each value in point.values
|
|
div #{value}
|
|
|
|
div *Stripe APIs do not return information about inactive subs.
|
|
|
|
h2 Recent Subscribers
|
|
if !subscribers || subscribers.length < 1
|
|
h4 Fetching recent subscribers...
|
|
else
|
|
table.table.table-condensed
|
|
thead
|
|
tr
|
|
th User Start
|
|
th Sub Start
|
|
if subscriberCancelled
|
|
th Cancelled
|
|
else
|
|
th
|
|
th
|
|
//- th Name
|
|
th Email
|
|
th Hero
|
|
th Level
|
|
th Last Level
|
|
th Age
|
|
th Spoken
|
|
tbody
|
|
each subscriber in subscribers
|
|
tr
|
|
td= subscriber.user.dateCreated.substring(0, 10)
|
|
td= subscriber.start.substring(0, 10)
|
|
td
|
|
if subscriber.cancel
|
|
span= subscriber.cancel.substring(0, 10)
|
|
td
|
|
if subscriber.user.stripe.sponsorID
|
|
span Sponsored
|
|
//- td
|
|
//- a(href="/user/#{subscriber.user._id}")= subscriber.user.name || 'Anoner'
|
|
td= subscriber.user.emailLower
|
|
td= subscriber.hero
|
|
td= subscriber.level
|
|
td= subscriber.user.lastLevel
|
|
td= subscriber.user.ageRange
|
|
td= subscriber.user.preferredLanguage
|
|
|
|
h2 Subscriptions
|
|
if !subs || subs.length < 1
|
|
h4 Fetching subscriptions...
|
|
else
|
|
table.table.table-condensed
|
|
thead
|
|
tr
|
|
th Day
|
|
th Total
|
|
th Started
|
|
th Cancelled
|
|
th Net
|
|
th Ended
|
|
tbody
|
|
each sub in subs
|
|
tr
|
|
td= sub.day
|
|
td= sub.total
|
|
td= sub.started
|
|
td= sub.cancelled
|
|
td= sub.started - sub.cancelled
|
|
td= sub.ended
|