From efd0d689fc92b3edb5e58252f78e24c737c0bc6b Mon Sep 17 00:00:00 2001 From: Lauryn Menard Date: Mon, 29 Jan 2024 14:53:53 +0100 Subject: [PATCH] templates: Move activity templates to /templates/corporate/activity. Also, renames `ad_hoc_query.html` to `activity_table.html`, `realm_summary_table.html` to `installation_activity_table.html`, and `activity_details_template.html` to `activity.html`. Removes the style attribute in the installation activity template and uses a CSS class, "installation-activity-header", to center the h3 and p tags instead. This removes an exception from the custom lint check. --- corporate/lib/activity.py | 2 +- corporate/views/installation_activity.py | 6 +++--- corporate/views/realm_activity.py | 2 +- corporate/views/remote_activity.py | 2 +- corporate/views/user_activity.py | 2 +- .../activity/activity.html} | 0 .../activity/activity_table.html} | 2 +- .../activity/installation_activity_table.html} | 4 ++-- .../activity}/remote_activity_key.html | 0 tools/linter_lib/custom_check.py | 1 - web/styles/portico/activity.css | 4 ++++ 11 files changed, 14 insertions(+), 11 deletions(-) rename templates/{analytics/activity_details_template.html => corporate/activity/activity.html} (100%) rename templates/{analytics/ad_hoc_query.html => corporate/activity/activity_table.html} (93%) rename templates/{analytics/realm_summary_table.html => corporate/activity/installation_activity_table.html} (95%) rename templates/{analytics => corporate/activity}/remote_activity_key.html (100%) diff --git a/corporate/lib/activity.py b/corporate/lib/activity.py index b6ddb91bb9..5e13bad835 100644 --- a/corporate/lib/activity.py +++ b/corporate/lib/activity.py @@ -66,7 +66,7 @@ def make_table( data = dict(title=title, cols=cols, rows=rows, totals=totals, stats_link=stats_link) content = loader.render_to_string( - "analytics/ad_hoc_query.html", + "corporate/activity/activity_table.html", dict(data=data), ) diff --git a/corporate/views/installation_activity.py b/corporate/views/installation_activity.py index 6a1b839940..491cef1e3c 100644 --- a/corporate/views/installation_activity.py +++ b/corporate/views/installation_activity.py @@ -271,7 +271,7 @@ def realm_summary_table() -> str: ] content = loader.render_to_string( - "analytics/realm_summary_table.html", + "corporate/activity/installation_activity_table.html", dict( rows=rows, totals=total_row, @@ -291,7 +291,7 @@ def get_installation_activity(request: HttpRequest) -> HttpResponse: return render( request, - "analytics/activity_details_template.html", + "corporate/activity/activity.html", context=dict(data=content, title=title, is_home=True), ) @@ -344,7 +344,7 @@ def get_integrations_activity(request: HttpRequest) -> HttpResponse: content = make_table(title, cols, rows) return render( request, - "analytics/activity_details_template.html", + "corporate/activity/activity.html", context=dict( data=content, title=title, diff --git a/corporate/views/realm_activity.py b/corporate/views/realm_activity.py index a83e8249f7..0ef67e3816 100644 --- a/corporate/views/realm_activity.py +++ b/corporate/views/realm_activity.py @@ -164,7 +164,7 @@ def get_realm_activity(request: HttpRequest, realm_str: str) -> HttpResponse: return render( request, - "analytics/activity_details_template.html", + "corporate/activity/activity.html", context=dict( data=content, title=title, diff --git a/corporate/views/remote_activity.py b/corporate/views/remote_activity.py index 74f5b78c34..70be4a2911 100644 --- a/corporate/views/remote_activity.py +++ b/corporate/views/remote_activity.py @@ -216,6 +216,6 @@ def get_remote_server_activity(request: HttpRequest) -> HttpResponse: content = make_table(title, cols, rows, totals=total_row) return render( request, - "analytics/activity_details_template.html", + "corporate/activity/activity.html", context=dict(data=content, title=title, is_home=False), ) diff --git a/corporate/views/user_activity.py b/corporate/views/user_activity.py index 4f46d784f8..29df5b7160 100644 --- a/corporate/views/user_activity.py +++ b/corporate/views/user_activity.py @@ -57,7 +57,7 @@ def get_user_activity(request: HttpRequest, user_profile_id: int) -> HttpRespons return render( request, - "analytics/activity_details_template.html", + "corporate/activity/activity.html", context=dict( data=content, title=title, diff --git a/templates/analytics/activity_details_template.html b/templates/corporate/activity/activity.html similarity index 100% rename from templates/analytics/activity_details_template.html rename to templates/corporate/activity/activity.html diff --git a/templates/analytics/ad_hoc_query.html b/templates/corporate/activity/activity_table.html similarity index 93% rename from templates/analytics/ad_hoc_query.html rename to templates/corporate/activity/activity_table.html index 9aba0b81cc..7657901f3a 100644 --- a/templates/analytics/ad_hoc_query.html +++ b/templates/corporate/activity/activity_table.html @@ -1,7 +1,7 @@

{{ data.title }} {% if data.stats_link %}{{ data.stats_link }}{% endif %}

{% if data.title == "Remote servers" %} -{% include "analytics/remote_activity_key.html" %} +{% include "corporate/activity/remote_activity_key.html" %} {% endif %} {{ data.rows|length}} rows diff --git a/templates/analytics/realm_summary_table.html b/templates/corporate/activity/installation_activity_table.html similarity index 95% rename from templates/analytics/realm_summary_table.html rename to templates/corporate/activity/installation_activity_table.html index fc671ec510..5943b3b671 100644 --- a/templates/analytics/realm_summary_table.html +++ b/templates/corporate/activity/installation_activity_table.html @@ -1,6 +1,6 @@ -

Installation activity: {{ num_active_sites }} active sites

+

Installation activity: {{ num_active_sites }} active sites

-

{{ utctime }}

+

{{ utctime }}

Installation information: