activity: Add realm stats link to "realm activtiy table".

This commit is contained in:
Shubham Dhama 2018-04-16 16:06:02 +05:30 committed by Tim Abbott
parent b26c38bc47
commit 03a2a9c792
2 changed files with 11 additions and 2 deletions

View File

@ -468,6 +468,7 @@ def realm_summary_table(realm_minutes: Dict[str, float]) -> str:
# formatting
for row in rows:
row['stats_link'] = realm_stats_link(row['string_id'])
row['string_id'] = realm_activity_link(row['string_id'])
# Count active sites
@ -489,6 +490,7 @@ def realm_summary_table(realm_minutes: Dict[str, float]) -> str:
rows.append(dict(
string_id='Total',
stats_link = '',
date_created_day='',
realm_admin_email='',
dau_count=total_dau_count,
@ -934,6 +936,12 @@ def realm_activity_link(realm_str: str) -> mark_safe:
realm_link = '<a href="%s">%s</a>' % (url, realm_str)
return mark_safe(realm_link)
def realm_stats_link(realm_str: str) -> mark_safe:
url_name = 'analytics.views.stats_for_realm'
url = reverse(url_name, kwargs=dict(realm_str=realm_str))
stats_link = '<a href="{}"><i class="fa fa-pie-chart"></i></a>'.format(url, realm_str)
return mark_safe(stats_link)
def realm_client_table(user_summaries: Dict[str, Dict[str, Dict[str, Any]]]) -> str:
exclude_keys = [
'internal',

View File

@ -37,7 +37,7 @@
<tr>
<th>Realm</th>
<th>Created (green if ≤12wk)</th>
<th><i class="fa fa-envelope"></i></th>
<th></th>
<th>DAU</th>
<th>WAU</th>
<th>Total users</th>
@ -63,12 +63,13 @@
{{ row.date_created_day }}
</td>
<td class="envelope">
<td>
{% if not loop.last %}
<a class="envelope-link" data-value="{{ row.realm_admin_email }}">
<i class="fa fa-envelope"></i>
</a>
{% endif %}
{{ row.stats_link }}
</td>
<td class="number">