From 6fcb095e7047cb25199b4ecd7d6cf87c9c25e93d Mon Sep 17 00:00:00 2001 From: Vishnu Ks Date: Wed, 15 Aug 2018 23:29:09 +0530 Subject: [PATCH] activity: Show plan_type in activity page. --- analytics/views.py | 4 ++++ templates/analytics/realm_summary_table.html | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/analytics/views.py b/analytics/views.py index 6bd9ee5231..8b02ef5ac7 100644 --- a/analytics/views.py +++ b/analytics/views.py @@ -355,6 +355,7 @@ def realm_summary_table(realm_minutes: Dict[str, float]) -> str: SELECT realm.string_id, realm.date_created, + realm.plan_type, coalesce(user_counts.dau_count, 0) dau_count, coalesce(wau_counts.wau_count, 0) wau_count, ( @@ -469,6 +470,8 @@ def realm_summary_table(realm_minutes: Dict[str, float]) -> str: for row in rows: row['date_created_day'] = row['date_created'].strftime('%Y-%m-%d') + row['plan_type_string'] = [ + '', 'self hosted', 'limited', 'premium', 'premium free'][row['plan_type']] row['age_days'] = int((now - row['date_created']).total_seconds() / 86400) row['is_new'] = row['age_days'] < 12 * 7 @@ -519,6 +522,7 @@ def realm_summary_table(realm_minutes: Dict[str, float]) -> str: rows.append(dict( string_id='Total', + plan_type_string="", stats_link = '', date_created_day='', realm_admin_email='', diff --git a/templates/analytics/realm_summary_table.html b/templates/analytics/realm_summary_table.html index 63ef72e490..37009ffb6e 100644 --- a/templates/analytics/realm_summary_table.html +++ b/templates/analytics/realm_summary_table.html @@ -38,6 +38,7 @@ Realm Created (green if ≤12wk) + Plan Type DAU WAU @@ -64,6 +65,10 @@ {{ row.date_created_day }} + + {{ row.plan_type_string }} + + {% if not loop.last %}