Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

templates: Move activity templates to /templates/corporate/activity.

Lauryn Menardefd0d689fc92
diff --git a/corporate/lib/activity.py b/corporate/lib/activity.py
index b6ddb91bb99..5e13bad8353 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 6a1b8399406..491cef1e3cd 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 a83e8249f7a..0ef67e38162 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 74f5b78c34b..70be4a2911b 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 4f46d784f80..29df5b7160f 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 9aba0b81cc5..7657901f3ae 100644
--- a/templates/analytics/ad_hoc_query.html
+++ b/templates/corporate/activity/activity_table.html
@@ -1,7 +1,7 @@
<h3>{{ data.title }} {% if data.stats_link %}{{ data.stats_link }}{% endif %}</h3>
{% 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 fc671ec5109..5943b3b6713 100644
--- a/templates/analytics/realm_summary_table.html
+++ b/templates/corporate/activity/installation_activity_table.html
@@ -1,6 +1,6 @@
-<h3 style="text-align: center;">Installation activity: {{ num_active_sites }} active sites</h3>
+<h3 class="installation-activity-header">Installation activity: {{ num_active_sites }} active sites</h3>
-<p style="text-align: center;">{{ utctime }}</p>
+<p class="installation-activity-header">{{ utctime }}</p>
<h4>Installation information:</h4>
<ul>
diff --git a/templates/analytics/remote_activity_key.html b/templates/corporate/activity/remote_activity_key.html
similarity index 100%
rename from templates/analytics/remote_activity_key.html
rename to templates/corporate/activity/remote_activity_key.html
diff --git a/tools/linter_lib/custom_check.py b/tools/linter_lib/custom_check.py
index 24edfb9e9f1..800039675ec 100644
--- a/tools/linter_lib/custom_check.py
+++ b/tools/linter_lib/custom_check.py
@@ -720,7 +720,6 @@ html_rules: List["Rule"] = [
"templates/zerver/accounts_send_confirm.html",
"templates/zerver/integrations/index.html",
"templates/zerver/documentation_main.html",
- "templates/analytics/realm_summary_table.html",
"templates/corporate/zephyr.html",
"templates/corporate/zephyr-mirror.html",
},
diff --git a/web/styles/portico/activity.css b/web/styles/portico/activity.css
index 75ccf89801b..83eaef0211b 100644
--- a/web/styles/portico/activity.css
+++ b/web/styles/portico/activity.css
@@ -244,6 +244,10 @@ tr.admin td:first-child {
}
}
+.installation-activity-header {
+ text-align: center;
+}
+
.remote-server-information,
.remote-realm-information {
padding-bottom: 15px;