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.

portico_error_pages: Collect zerver error pages into a folder.

Aman Agrawal96dee2b987a2
diff --git a/corporate/views/remote_billing_page.py b/corporate/views/remote_billing_page.py
index 41bda0279b2..d6ec5e06fde 100644
--- a/corporate/views/remote_billing_page.py
+++ b/corporate/views/remote_billing_page.py
@@ -830,7 +830,7 @@ def check_rate_limits(
assert e.secs_to_freedom is not None
return render(
request,
- "zerver/rate_limit_exceeded.html",
+ "zerver/portico_error_pages/rate_limit_exceeded.html",
context={"retry_after": int(e.secs_to_freedom)},
status=429,
)
diff --git a/templates/404.html b/templates/404.html
index 88ef8a968fb..a0132ebd120 100644
--- a/templates/404.html
+++ b/templates/404.html
@@ -1,4 +1,4 @@
-{% extends "zerver/portico_error_page.html" %}
+{% extends "zerver/portico_error_pages/portico_error_page.html" %}
{% block title %}
<title>{{ _("Error") }} | Zulip</title>
diff --git a/templates/4xx.html b/templates/4xx.html
index a5b8df23d6a..15f36cd0b79 100644
--- a/templates/4xx.html
+++ b/templates/4xx.html
@@ -1,4 +1,4 @@
-{% extends "zerver/portico_error_page.html" %}
+{% extends "zerver/portico_error_pages/portico_error_page.html" %}
{% block title %}
<title>{{ _("Error") }} | Zulip</title>
diff --git a/templates/500.html b/templates/500.html
index cec4b27c40a..c8507fd5ea0 100644
--- a/templates/500.html
+++ b/templates/500.html
@@ -1,4 +1,4 @@
-{% extends "zerver/portico_error_page.html" %}
+{% extends "zerver/portico_error_pages/portico_error_page.html" %}
{% block title %}
<title>{{ _("Internal server error") }} | Zulip</title>
diff --git a/templates/confirmation/link_does_not_exist.html b/templates/confirmation/link_does_not_exist.html
index deaa1fd3f75..fce7797d753 100644
--- a/templates/confirmation/link_does_not_exist.html
+++ b/templates/confirmation/link_does_not_exist.html
@@ -1,4 +1,4 @@
-{% extends "zerver/portico_error_page.html" %}
+{% extends "zerver/portico_error_pages/portico_error_page.html" %}
{% block title %}
<title>{{ _("Confirmation link does not exist") }} | Zulip</title>
diff --git a/templates/confirmation/link_expired.html b/templates/confirmation/link_expired.html
index 19438a91d05..ef4923c7ebf 100644
--- a/templates/confirmation/link_expired.html
+++ b/templates/confirmation/link_expired.html
@@ -1,4 +1,4 @@
-{% extends "zerver/portico_error_page.html" %}
+{% extends "zerver/portico_error_pages/portico_error_page.html" %}
{% block title %}
<title>{{ _("Confirmation link expired or deactivated") }} | Zulip</title>
diff --git a/templates/confirmation/link_malformed.html b/templates/confirmation/link_malformed.html
index 66f66d37cfe..1e475e589c3 100644
--- a/templates/confirmation/link_malformed.html
+++ b/templates/confirmation/link_malformed.html
@@ -1,4 +1,4 @@
-{% extends "zerver/portico_error_page.html" %}
+{% extends "zerver/portico_error_pages/portico_error_page.html" %}
{% block title %}
<title>{{ _("Confirmation link malformed") }} | Zulip</title>
diff --git a/templates/corporate/billing/remote_realm_login_error_for_server_on_active_plan.html b/templates/corporate/billing/remote_realm_login_error_for_server_on_active_plan.html
index 16678d03092..0c9e4af0705 100644
--- a/templates/corporate/billing/remote_realm_login_error_for_server_on_active_plan.html
+++ b/templates/corporate/billing/remote_realm_login_error_for_server_on_active_plan.html
@@ -1,4 +1,4 @@
-{% extends "zerver/portico_error_page.html" %}
+{% extends "zerver/portico_error_pages/portico_error_page.html" %}
{% block title %}
<title>{{ _("Plan management not available") }} | Zulip</title>
diff --git a/templates/corporate/billing/remote_server_login_error_for_any_realm_on_active_plan.html b/templates/corporate/billing/remote_server_login_error_for_any_realm_on_active_plan.html
index 9b44038b7da..779fc847b17 100644
--- a/templates/corporate/billing/remote_server_login_error_for_any_realm_on_active_plan.html
+++ b/templates/corporate/billing/remote_server_login_error_for_any_realm_on_active_plan.html
@@ -1,4 +1,4 @@
-{% extends "zerver/portico_error_page.html" %}
+{% extends "zerver/portico_error_pages/portico_error_page.html" %}
{% block title %}
<title>{{ _("Plan management not available") }} | Zulip</title>
diff --git a/templates/corporate/billing/remote_server_rate_limit_exceeded.html b/templates/corporate/billing/remote_server_rate_limit_exceeded.html
index 0f8ce4bf9fa..c8142e2692e 100644
--- a/templates/corporate/billing/remote_server_rate_limit_exceeded.html
+++ b/templates/corporate/billing/remote_server_rate_limit_exceeded.html
@@ -1,4 +1,4 @@
-{% extends "zerver/portico_error_page.html" %}
+{% extends "zerver/portico_error_pages/portico_error_page.html" %}
{% block title %}
<title>{{ _("Rate limit exceeded") }} | Zulip</title>
diff --git a/templates/zerver/auth_subdomain.html b/templates/zerver/portico_error_pages/auth_subdomain.html
similarity index 92%
rename from templates/zerver/auth_subdomain.html
rename to templates/zerver/portico_error_pages/auth_subdomain.html
index 0c6cca40b14..a19612bd623 100644
--- a/templates/zerver/auth_subdomain.html
+++ b/templates/zerver/portico_error_pages/auth_subdomain.html
@@ -1,4 +1,4 @@
-{% extends "zerver/portico_error_page.html" %}
+{% extends "zerver/portico_error_pages/portico_error_page.html" %}
{% block title %}
<title>{{ _("Authentication subdomain error") }} | Zulip</title>
diff --git a/templates/zerver/insecure_desktop_app.html b/templates/zerver/portico_error_pages/insecure_desktop_app.html
similarity index 93%
rename from templates/zerver/insecure_desktop_app.html
rename to templates/zerver/portico_error_pages/insecure_desktop_app.html
index 8db65006955..10353dbf17a 100644
--- a/templates/zerver/insecure_desktop_app.html
+++ b/templates/zerver/portico_error_pages/insecure_desktop_app.html
@@ -1,4 +1,4 @@
-{% extends "zerver/portico_error_page.html" %}
+{% extends "zerver/portico_error_pages/portico_error_page.html" %}
{% block title %}
<title>{{ _("Update required") }} | Zulip</title>
diff --git a/templates/zerver/portico_error_page.html b/templates/zerver/portico_error_pages/portico_error_page.html
similarity index 100%
rename from templates/zerver/portico_error_page.html
rename to templates/zerver/portico_error_pages/portico_error_page.html
diff --git a/templates/zerver/rate_limit_exceeded.html b/templates/zerver/portico_error_pages/rate_limit_exceeded.html
similarity index 89%
rename from templates/zerver/rate_limit_exceeded.html
rename to templates/zerver/portico_error_pages/rate_limit_exceeded.html
index 6b4771bc104..72ef4a73d43 100644
--- a/templates/zerver/rate_limit_exceeded.html
+++ b/templates/zerver/portico_error_pages/rate_limit_exceeded.html
@@ -1,4 +1,4 @@
-{% extends "zerver/portico_error_page.html" %}
+{% extends "zerver/portico_error_pages/portico_error_page.html" %}
{% block title %}
<title>{{ _("Rate limit exceeded") }} | Zulip</title>
diff --git a/templates/zerver/realm_creation_disabled.html b/templates/zerver/portico_error_pages/realm_creation_disabled.html
similarity index 91%
rename from templates/zerver/realm_creation_disabled.html
rename to templates/zerver/portico_error_pages/realm_creation_disabled.html
index 587d66fb9b2..0e481d80c31 100644
--- a/templates/zerver/realm_creation_disabled.html
+++ b/templates/zerver/portico_error_pages/realm_creation_disabled.html
@@ -1,4 +1,4 @@
-{% extends "zerver/portico_error_page.html" %}
+{% extends "zerver/portico_error_pages/portico_error_page.html" %}
{% block title %}
<title>{{ _("Organization creation link required") }} | Zulip</title>
diff --git a/templates/zerver/realm_creation_link_invalid.html b/templates/zerver/portico_error_pages/realm_creation_link_invalid.html
similarity index 90%
rename from templates/zerver/realm_creation_link_invalid.html
rename to templates/zerver/portico_error_pages/realm_creation_link_invalid.html
index 5b3f393f9c4..cf813b0db58 100644
--- a/templates/zerver/realm_creation_link_invalid.html
+++ b/templates/zerver/portico_error_pages/realm_creation_link_invalid.html
@@ -1,4 +1,4 @@
-{% extends "zerver/portico_error_page.html" %}
+{% extends "zerver/portico_error_pages/portico_error_page.html" %}
{% block title %}
<title>{{ _("Organization creation link expired or invalid") }} | Zulip</title>
diff --git a/templates/zerver/remote_realm_server_mismatch_error.html b/templates/zerver/portico_error_pages/remote_realm_server_mismatch_error.html
similarity index 90%
rename from templates/zerver/remote_realm_server_mismatch_error.html
rename to templates/zerver/portico_error_pages/remote_realm_server_mismatch_error.html
index 20ee178ad6a..15ee246265b 100644
--- a/templates/zerver/remote_realm_server_mismatch_error.html
+++ b/templates/zerver/portico_error_pages/remote_realm_server_mismatch_error.html
@@ -1,4 +1,4 @@
-{% extends "zerver/portico_error_page.html" %}
+{% extends "zerver/portico_error_pages/portico_error_page.html" %}
{% block title %}
<title>{{ _("Error") }} | Zulip</title>
diff --git a/templates/zerver/unsupported_browser.html b/templates/zerver/portico_error_pages/unsupported_browser.html
similarity index 93%
rename from templates/zerver/unsupported_browser.html
rename to templates/zerver/portico_error_pages/unsupported_browser.html
index f1ca3a099b6..f4fd68e7bb0 100644
--- a/templates/zerver/unsupported_browser.html
+++ b/templates/zerver/portico_error_pages/unsupported_browser.html
@@ -1,4 +1,4 @@
-{% extends "zerver/portico_error_page.html" %}
+{% extends "zerver/portico_error_pages/portico_error_page.html" %}
{% block title %}
<title>{{ _("Unsupported browser") }} | Zulip</title>
diff --git a/zerver/views/auth.py b/zerver/views/auth.py
index 448f965f3a7..268f7831bbf 100644
--- a/zerver/views/auth.py
+++ b/zerver/views/auth.py
@@ -928,7 +928,7 @@ def social_auth_subdomain_login_page(request: HttpRequest) -> HttpResponse:
except Realm.DoesNotExist:
pass
- return render(request, "zerver/auth_subdomain.html", status=400)
+ return render(request, "zerver/portico_error_pages/auth_subdomain.html", status=400)
def start_two_factor_auth(
@@ -1208,7 +1208,7 @@ def password_reset(request: HttpRequest) -> HttpResponse:
assert e.secs_to_freedom is not None
return render(
request,
- "zerver/rate_limit_exceeded.html",
+ "zerver/portico_error_pages/rate_limit_exceeded.html",
context={"retry_after": int(e.secs_to_freedom)},
status=429,
)
diff --git a/zerver/views/home.py b/zerver/views/home.py
index 5ea485048aa..76ccfb0672d 100644
--- a/zerver/views/home.py
+++ b/zerver/views/home.py
@@ -178,7 +178,7 @@ def home_real(request: HttpRequest) -> HttpResponse:
if banned_desktop_app:
return render(
request,
- "zerver/insecure_desktop_app.html",
+ "zerver/portico_error_pages/insecure_desktop_app.html",
context={
"auto_update_broken": auto_update_broken,
},
@@ -187,7 +187,7 @@ def home_real(request: HttpRequest) -> HttpResponse:
if unsupported_browser:
return render(
request,
- "zerver/unsupported_browser.html",
+ "zerver/portico_error_pages/unsupported_browser.html",
context={
"browser_name": browser_name,
},
diff --git a/zerver/views/push_notifications.py b/zerver/views/push_notifications.py
index 83f2e830c52..7f26d7182b8 100644
--- a/zerver/views/push_notifications.py
+++ b/zerver/views/push_notifications.py
@@ -184,7 +184,11 @@ def self_hosting_auth_redirect_endpoint(
except ResourceNotFoundError:
return render(request, "404.html", status=404)
except RemoteRealmServerMismatchError:
- return render(request, "zerver/remote_realm_server_mismatch_error.html", status=403)
+ return render(
+ request,
+ "zerver/portico_error_pages/remote_realm_server_mismatch_error.html",
+ status=403,
+ )
return HttpResponseRedirect(redirect_url)
diff --git a/zerver/views/registration.py b/zerver/views/registration.py
index 8296f951e9f..4ca44e947ee 100644
--- a/zerver/views/registration.py
+++ b/zerver/views/registration.py
@@ -862,12 +862,12 @@ def create_realm(request: HttpRequest, creation_key: Optional[str] = None) -> Ht
except RealmCreationKey.InvalidError:
return TemplateResponse(
request,
- "zerver/realm_creation_link_invalid.html",
+ "zerver/portico_error_pages/realm_creation_link_invalid.html",
)
if not settings.OPEN_REALM_CREATION and key_record is None:
return TemplateResponse(
request,
- "zerver/realm_creation_disabled.html",
+ "zerver/portico_error_pages/realm_creation_disabled.html",
)
# When settings.OPEN_REALM_CREATION is enabled, anyone can create a new realm,
@@ -881,7 +881,7 @@ def create_realm(request: HttpRequest, creation_key: Optional[str] = None) -> Ht
assert e.secs_to_freedom is not None
return TemplateResponse(
request,
- "zerver/rate_limit_exceeded.html",
+ "zerver/portico_error_pages/rate_limit_exceeded.html",
context={"retry_after": int(e.secs_to_freedom)},
status=429,
)
@@ -1049,7 +1049,7 @@ def accounts_home(
assert e.secs_to_freedom is not None
return render(
request,
- "zerver/rate_limit_exceeded.html",
+ "zerver/portico_error_pages/rate_limit_exceeded.html",
context={"retry_after": int(e.secs_to_freedom)},
status=429,
)
@@ -1133,7 +1133,7 @@ def find_account(request: HttpRequest) -> HttpResponse:
assert e.secs_to_freedom is not None
return render(
request,
- "zerver/rate_limit_exceeded.html",
+ "zerver/portico_error_pages/rate_limit_exceeded.html",
context={"retry_after": int(e.secs_to_freedom)},
status=429,
)