2015-03-27 14:22:21 -04:00
|
|
|
extends /templates/base
|
|
|
|
|
|
|
|
block content
|
2015-04-07 18:00:50 -04:00
|
|
|
|
2015-03-27 14:22:21 -04:00
|
|
|
if !me.isAdmin()
|
|
|
|
div You must be logged in as an admin to view this page.
|
|
|
|
else
|
2015-04-07 18:00:50 -04:00
|
|
|
|
2015-03-27 14:22:21 -04:00
|
|
|
if total === 0
|
2015-07-08 20:34:31 -04:00
|
|
|
h4= refreshDataState
|
2015-03-27 14:22:21 -04:00
|
|
|
else
|
2015-04-06 19:58:36 -04:00
|
|
|
.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
|
2015-07-08 20:34:31 -04:00
|
|
|
div.count= total - outstandingCancels.length
|
2015-04-06 19:58:36 -04:00
|
|
|
.col-md-5.big-stat.cancelled-count
|
2015-07-08 20:34:31 -04:00
|
|
|
div.description Cancels Outstanding
|
|
|
|
div.count= outstandingCancels.length
|
2015-04-06 19:58:36 -04:00
|
|
|
.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
|
2015-05-01 20:26:22 -04:00
|
|
|
div.description Monthly Churn (cancelled / total)
|
2015-04-06 19:58:36 -04:00
|
|
|
div.count #{monthlyChurn.toFixed(1)}%
|
|
|
|
|
2015-03-27 18:27:22 -04:00
|
|
|
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}
|
|
|
|
|
2015-04-07 18:00:50 -04:00
|
|
|
h2 Recent Subscribers
|
|
|
|
if !subscribers || subscribers.length < 1
|
2015-07-08 20:34:31 -04:00
|
|
|
h4= refreshDataState
|
2015-04-07 18:00:50 -04:00
|
|
|
else
|
2015-04-21 18:58:45 -04:00
|
|
|
table.table.table-striped.table-condensed
|
2015-04-23 16:34:41 -04:00
|
|
|
thead.subscribers-thead
|
2015-04-07 18:00:50 -04:00
|
|
|
tr
|
2015-04-21 18:58:45 -04:00
|
|
|
th Sub ID
|
2015-04-07 18:00:50 -04:00
|
|
|
th User Start
|
|
|
|
th Sub Start
|
2015-04-08 14:53:22 -04:00
|
|
|
if subscriberCancelled
|
|
|
|
th Cancelled
|
|
|
|
else
|
|
|
|
th
|
2015-05-01 12:37:43 -04:00
|
|
|
th Conversion
|
2015-04-07 18:00:50 -04:00
|
|
|
th Email
|
|
|
|
th Hero
|
|
|
|
th Level
|
|
|
|
th Age
|
|
|
|
th Spoken
|
2015-04-23 16:34:41 -04:00
|
|
|
th Clans
|
2015-04-21 18:58:45 -04:00
|
|
|
tbody.subscribers-tbody
|
2015-04-07 18:00:50 -04:00
|
|
|
each subscriber in subscribers
|
|
|
|
tr
|
2015-04-21 18:58:45 -04:00
|
|
|
td
|
2015-05-06 18:23:46 -04:00
|
|
|
a(href="https://dashboard.stripe.com/customers/#{subscriber.customerID}", target="_blank")= subscriber.subscriptionID
|
2015-04-07 18:00:50 -04:00
|
|
|
td= subscriber.user.dateCreated.substring(0, 10)
|
2015-07-08 20:34:31 -04:00
|
|
|
td= subscriber.start.toISOString().substring(0, 10)
|
2015-04-07 18:00:50 -04:00
|
|
|
td
|
|
|
|
if subscriber.cancel
|
2015-07-08 20:34:31 -04:00
|
|
|
span= subscriber.cancel.toISOString().substring(0, 10)
|
2015-04-07 18:00:50 -04:00
|
|
|
td
|
2015-05-11 13:37:30 -04:00
|
|
|
if subscriber.user.stripe && subscriber.user.stripe.sponsorID
|
2015-05-01 12:37:43 -04:00
|
|
|
span *sponsored*
|
|
|
|
else if subscriber.user.conversion
|
|
|
|
span= subscriber.user.conversion
|
2015-05-11 13:37:30 -04:00
|
|
|
if subscriber.user.deleted
|
|
|
|
td DELETED
|
|
|
|
else
|
|
|
|
td= subscriber.user.emailLower
|
2015-04-07 18:00:50 -04:00
|
|
|
td= subscriber.hero
|
|
|
|
td= subscriber.level
|
|
|
|
td= subscriber.user.ageRange
|
|
|
|
td= subscriber.user.preferredLanguage
|
2015-04-23 16:34:41 -04:00
|
|
|
if subscriber.user.clans
|
|
|
|
td= subscriber.user.clans.length
|
|
|
|
else
|
|
|
|
td
|
2015-04-07 18:00:50 -04:00
|
|
|
|
2015-05-06 18:23:46 -04:00
|
|
|
h2 Recent Cancellations
|
|
|
|
if !cancellations || cancellations.length < 1
|
2015-07-08 20:34:31 -04:00
|
|
|
h4= refreshDataState
|
2015-05-06 18:23:46 -04:00
|
|
|
else
|
|
|
|
table.table.table-striped.table-condensed
|
|
|
|
thead.subscribers-thead
|
|
|
|
tr
|
|
|
|
th Sub ID
|
|
|
|
th User ID
|
|
|
|
th User Start
|
|
|
|
th Sub Start
|
|
|
|
th Sub Cancel
|
|
|
|
th Length
|
|
|
|
th Level
|
|
|
|
th Age
|
|
|
|
th Spoken
|
|
|
|
th Clans
|
|
|
|
tbody.subscribers-tbody
|
|
|
|
each cancellation in cancellations
|
|
|
|
tr
|
|
|
|
td
|
|
|
|
a(href="https://dashboard.stripe.com/customers/#{cancellation.customerID}", target="_blank")= cancellation.subscriptionID
|
|
|
|
if cancellation.userID
|
|
|
|
td
|
|
|
|
a(href="/user/#{cancellation.userID}")= cancellation.userID
|
|
|
|
else
|
|
|
|
td
|
|
|
|
if cancellation.user
|
|
|
|
td= cancellation.user.dateCreated.substring(0, 10)
|
|
|
|
else
|
|
|
|
td
|
2015-07-08 20:34:31 -04:00
|
|
|
td= cancellation.start.toISOString().substring(0, 10)
|
|
|
|
td= cancellation.cancel.toISOString().substring(0, 10)
|
|
|
|
td= moment.duration(cancellation.cancel - cancellation.start).humanize()
|
2015-05-06 18:23:46 -04:00
|
|
|
td= cancellation.level
|
|
|
|
if cancellation.user
|
|
|
|
td= cancellation.user.ageRange
|
|
|
|
td= cancellation.user.preferredLanguage
|
|
|
|
if cancellation.user.clans
|
|
|
|
td= cancellation.user.clans.length
|
|
|
|
else
|
|
|
|
td
|
|
|
|
else
|
|
|
|
td
|
|
|
|
td
|
|
|
|
td
|
|
|
|
td
|
2015-08-23 18:32:44 -04:00
|
|
|
if !showMoreCancellations
|
|
|
|
button.btn.btn-sm.btn-show-more-cancellations Show More Cancellations
|
2015-05-06 18:23:46 -04:00
|
|
|
|
2015-04-07 18:00:50 -04:00
|
|
|
h2 Subscriptions
|
|
|
|
if !subs || subs.length < 1
|
2015-07-08 20:34:31 -04:00
|
|
|
h4= refreshDataState
|
2015-04-07 18:00:50 -04:00
|
|
|
else
|
|
|
|
table.table.table-condensed
|
2015-03-27 14:22:21 -04:00
|
|
|
thead
|
|
|
|
tr
|
|
|
|
th Day
|
|
|
|
th Total
|
|
|
|
th Started
|
|
|
|
th Cancelled
|
2015-04-23 16:34:41 -04:00
|
|
|
th Net (cancelled)
|
2015-04-10 14:27:55 -04:00
|
|
|
th Ended
|
2015-04-23 16:34:41 -04:00
|
|
|
th Net (ended)
|
2015-03-27 14:22:21 -04:00
|
|
|
tbody
|
|
|
|
each sub in subs
|
|
|
|
tr
|
|
|
|
td= sub.day
|
|
|
|
td= sub.total
|
|
|
|
td= sub.started
|
|
|
|
td= sub.cancelled
|
2015-04-07 18:00:50 -04:00
|
|
|
td= sub.started - sub.cancelled
|
2015-04-10 14:27:55 -04:00
|
|
|
td= sub.ended
|
2015-04-23 16:34:41 -04:00
|
|
|
td= sub.started - sub.ended
|