diff --git a/corehq/apps/enterprise/templates/enterprise/project_dashboard.html b/corehq/apps/enterprise/templates/enterprise/project_dashboard.html index e07d585a4708..1eac670275d6 100644 --- a/corehq/apps/enterprise/templates/enterprise/project_dashboard.html +++ b/corehq/apps/enterprise/templates/enterprise/project_dashboard.html @@ -1,25 +1,23 @@ {% extends "hqwebapp/bootstrap5/base_section.html" %} {% load hq_shared_tags %} {% load i18n %} - -{% block page_title %}{{ current_page.title }}{% endblock %} - {% js_entry 'enterprise/js/project_dashboard' %} {% block page_content %} {% registerurl "enterprise_dashboard_email" domain "---" %} {% registerurl "enterprise_dashboard_total" domain "---" %} - {% initial_page_data 'max_date_range_days' max_date_range_days %} {% initial_page_data 'metric_type' metric_type %} -
- {% for report in reports %} -
- {% include 'enterprise/partials/project_tile.html' with report=report uses_date_range=uses_date_range %} -
- {% endfor %} -
- + {% for group in groups %} +
+

{{ group.name }}

+ {% for report in group.reports %} +
+ {% include 'enterprise/partials/project_tile.html' with report=report uses_date_range=uses_date_range %} +
+ {% endfor %} +
+ {% endfor %} {% include 'enterprise/partials/date_range_modal.html' %} {% endblock %} diff --git a/corehq/apps/enterprise/views.py b/corehq/apps/enterprise/views.py index e2cf427ba1d5..d88eac2573c6 100644 --- a/corehq/apps/enterprise/views.py +++ b/corehq/apps/enterprise/views.py @@ -73,8 +73,8 @@ def platform_overview(request, domain): context = get_page_context( page_url=reverse('platform_overview', args=(domain,)), - page_title=_('Platform Overview for {}').format(request.account.name), page_name=_('Platform Overview'), + page_title='', domain=domain, section=Section( _('Enterprise Console'), @@ -84,15 +84,21 @@ def platform_overview(request, domain): context.update({ 'max_date_range_days': EnterpriseFormReport.MAX_DATE_RANGE_DAYS, - 'reports': [EnterpriseReport.create(slug, request.account.id, request.couch_user) for slug in ( - EnterpriseReport.DOMAINS, - EnterpriseReport.WEB_USERS, - EnterpriseReport.MOBILE_USERS, - EnterpriseReport.FORM_SUBMISSIONS, - EnterpriseReport.ODATA_FEEDS, - EnterpriseReport.COMMCARE_VERSION_COMPLIANCE, - EnterpriseReport.SMS, - )], + 'groups': [ + {'name': 'Projects Overview', + 'reports': [EnterpriseReport.create(slug, request.account.id, request.couch_user) + for slug in (EnterpriseReport.DOMAINS, + EnterpriseReport.FORM_SUBMISSIONS, + EnterpriseReport.SMS,)]}, + {'name': 'User Management', + 'reports': [EnterpriseReport.create(slug, request.account.id, request.couch_user) + for slug in (EnterpriseReport.WEB_USERS, + EnterpriseReport.MOBILE_USERS, + EnterpriseReport.COMMCARE_VERSION_COMPLIANCE,)]}, + {'name': 'Data Management & Export', + 'reports': [EnterpriseReport.create(slug, request.account.id, request.couch_user) + for slug in (EnterpriseReport.ODATA_FEEDS,)]}, + ], 'uses_date_range': [EnterpriseReport.FORM_SUBMISSIONS, EnterpriseReport.SMS], 'metric_type': 'Platform Overview', }) @@ -111,7 +117,7 @@ def security_center(request, domain): context = get_page_context( page_url=reverse('security_center', args=(domain,)), - page_title=_('Security Center for {}').format(request.account.name), + page_title='', page_name=_('Security Center'), domain=domain, section=Section( @@ -121,10 +127,12 @@ def security_center(request, domain): ) context.update({ - 'reports': [EnterpriseReport.create(slug, request.account.id, request.couch_user) for slug in ( - EnterpriseReport.API_USAGE, - EnterpriseReport.TWO_FACTOR_AUTH, - )], + 'groups': [ + {'name': '', + 'reports': [EnterpriseReport.create(slug, request.account.id, request.couch_user) + for slug in (EnterpriseReport.API_USAGE, + EnterpriseReport.TWO_FACTOR_AUTH)]}, + ], 'metric_type': 'Security Center', 'max_date_range_days': EnterpriseFormReport.MAX_DATE_RANGE_DAYS, 'uses_date_range': [],