Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Subscription cancellations admin page
- Loading branch information
1 parent
0b36fc8
commit 029deed
Showing
6 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
extends /templates/base | ||
|
||
//- DO NOT TRANSLATE | ||
block content | ||
|
||
if me.isAdmin() | ||
h1 Subscription Cancellations | ||
.small Returning #{view.limit} max latest cancellations, set 'limit' query variable to change. | ||
br | ||
if view.cancelEvents | ||
table.table-striped.table-condensed | ||
tr | ||
td Date | ||
td User Id | ||
td Message | ||
each event in view.cancelEvents | ||
tr | ||
td #{view.objectIdToDate(event._id).toISOString()} | ||
td #{event.user} | ||
if event.properties | ||
td #{event.properties.message} | ||
else | ||
td | ||
else | ||
h3 Loading.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
RootView = require 'views/core/RootView' | ||
CocoCollection = require 'collections/CocoCollection' | ||
utils = require 'core/utils' | ||
|
||
module.exports = class AdminSubCancellationsView extends RootView | ||
id: 'admin-sub-cancellations-view' | ||
template: require 'templates/admin/admin-sub-cancellations' | ||
|
||
initialize: -> | ||
return super() unless me.isAdmin() | ||
@objectIdToDate = utils.objectIdToDate | ||
@limit = utils.getQueryVariable('limit', 100) | ||
url = '/db/analytics.log.event?filter[event]="Unsubscribe End"&conditions[sort]="-_id"&conditions[limit]=' + @limit | ||
Promise.resolve($.get(url)) | ||
.then (@cancelEvents) => | ||
@render?() | ||
super() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters