From 1d45ad8b2ab1c41dd489ccd581d027077bc917e5 Mon Sep 17 00:00:00 2001
From: Germain
Date: Fri, 21 Oct 2022 18:44:00 +0100
Subject: Improve aesthetics and reusability of HTML templates. (#13652)
Use a base template to create a cohesive feel across the HTML
templates provided by Synapse.
Adds basic styling to the base template for a more user-friendly
look and feel.
---
synapse/res/templates/_base.html | 29 ++
.../res/templates/account_previously_renewed.html | 18 +-
synapse/res/templates/account_renewed.html | 18 +-
synapse/res/templates/add_threepid.html | 22 +-
synapse/res/templates/add_threepid_failure.html | 20 +-
synapse/res/templates/add_threepid_success.html | 18 +-
synapse/res/templates/auth_success.html | 28 +-
synapse/res/templates/invalid_token.html | 17 +-
synapse/res/templates/notice_expiry.html | 93 +++---
synapse/res/templates/notif_mail.html | 116 ++++---
synapse/res/templates/password_reset.html | 19 +-
.../res/templates/password_reset_confirmation.html | 14 +-
synapse/res/templates/password_reset_failure.html | 14 +-
synapse/res/templates/password_reset_success.html | 12 +-
synapse/res/templates/recaptcha.html | 19 +-
synapse/res/templates/registration.html | 21 +-
synapse/res/templates/registration_failure.html | 12 +-
synapse/res/templates/registration_success.html | 13 +-
synapse/res/templates/registration_token.html | 16 +-
synapse/res/templates/sso_account_deactivated.html | 49 ++-
.../res/templates/sso_auth_account_details.html | 372 ++++++++++-----------
synapse/res/templates/sso_auth_bad_user.html | 52 ++-
synapse/res/templates/sso_auth_confirm.html | 56 ++--
synapse/res/templates/sso_auth_success.html | 54 ++-
synapse/res/templates/sso_error.html | 34 +-
synapse/res/templates/sso_login_idp_picker.html | 114 +++----
synapse/res/templates/sso_new_user_consent.html | 60 ++--
synapse/res/templates/sso_redirect_confirm.html | 75 ++---
synapse/res/templates/style.css | 29 ++
synapse/res/templates/terms.html | 16 +-
30 files changed, 690 insertions(+), 740 deletions(-)
create mode 100644 synapse/res/templates/_base.html
create mode 100644 synapse/res/templates/style.css
(limited to 'synapse/res')
diff --git a/synapse/res/templates/_base.html b/synapse/res/templates/_base.html
new file mode 100644
index 0000000000..46439fce6a
--- /dev/null
+++ b/synapse/res/templates/_base.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+ {% block title %}{% endblock %}
+
+ {% block header %}{% endblock %}
+
+
+
+ {% if app_name == "Riot" %}
+
+ {% elif app_name == "Vector" %}
+
+ {% elif app_name == "Element" %}
+
+ {% else %}
+
+ {% endif %}
+
+
+{% block body %}{% endblock %}
+
+
+
diff --git a/synapse/res/templates/account_previously_renewed.html b/synapse/res/templates/account_previously_renewed.html
index bd4f7cea97..91582a8af0 100644
--- a/synapse/res/templates/account_previously_renewed.html
+++ b/synapse/res/templates/account_previously_renewed.html
@@ -1,12 +1,6 @@
-
-
-
-
-
-
- Your account is valid until {{ expiration_ts|format_ts("%d-%m-%Y") }}.
-
-
- Your account is valid until {{ expiration_ts|format_ts("%d-%m-%Y") }}.
-
-
\ No newline at end of file
+{% extends "_base.html" %}
+{% block title %}Your account is valid until {{ expiration_ts|format_ts("%d-%m-%Y") }}.{% endblock %}
+
+{% block body %}
+
Your account is valid until {{ expiration_ts|format_ts("%d-%m-%Y") }}.
+{% endblock %}
diff --git a/synapse/res/templates/account_renewed.html b/synapse/res/templates/account_renewed.html
index 57b319f375..18a57833f1 100644
--- a/synapse/res/templates/account_renewed.html
+++ b/synapse/res/templates/account_renewed.html
@@ -1,12 +1,6 @@
-
-
-
-
-
-
- Your account has been successfully renewed and is valid until {{ expiration_ts|format_ts("%d-%m-%Y") }}.
-
-
- Your account has been successfully renewed and is valid until {{ expiration_ts|format_ts("%d-%m-%Y") }}.
-
-
\ No newline at end of file
+{% extends "_base.html" %}
+{% block title %}Your account has been successfully renewed and is valid until {{ expiration_ts|format_ts("%d-%m-%Y") }}.{% endblock %}
+
+{% block body %}
+
Your account has been successfully renewed and is valid until {{ expiration_ts|format_ts("%d-%m-%Y") }}.
+{% endblock %}
diff --git a/synapse/res/templates/add_threepid.html b/synapse/res/templates/add_threepid.html
index 71f2215b7a..33c883936a 100644
--- a/synapse/res/templates/add_threepid.html
+++ b/synapse/res/templates/add_threepid.html
@@ -1,14 +1,8 @@
-
-
-
-
-
-
- Request to add an email address to your Matrix account
-
-
-
A request to add an email address to your Matrix account has been received. If this was you, please click the link below to confirm adding this email:
Validation failed for the following reason: {{ failure_reason }}.
-
-
+{% endblock %}
diff --git a/synapse/res/templates/registration_success.html b/synapse/res/templates/registration_success.html
index d51d5549d8..e2dd020a9e 100644
--- a/synapse/res/templates/registration_success.html
+++ b/synapse/res/templates/registration_success.html
@@ -1,10 +1,5 @@
-
-
- Your email has now been validated
-
-
-
-
+{% block title %}Your email has now been validated{% endblock %}
+
+{% block body %}
Your email has now been validated, please return to your client. You may now close this window.
- Your account might have been deactivated by the server administrator.
- You can either try to create a new account or contact the server’s
- administrator.
-
-
- {% include "sso_footer.html" without context %}
-
-
+{% block title %}SSO account deactivated{% endblock %}
+
+{% block header %}
+
+{% endblock %}
+
+{% block body %}
+
+
+
Your account has been deactivated
+
+ No account found
+
+
+ Your account might have been deactivated by the server administrator.
+ You can either try to create a new account or contact the server’s
+ administrator.
+
+
+
+{% include "sso_footer.html" without context %}
+{% endblock %}
diff --git a/synapse/res/templates/sso_auth_account_details.html b/synapse/res/templates/sso_auth_account_details.html
index 2d1db386e1..b516333373 100644
--- a/synapse/res/templates/sso_auth_account_details.html
+++ b/synapse/res/templates/sso_auth_account_details.html
@@ -1,189 +1,185 @@
-
-
-
- Create your account
-
-
-
-
-
-
-
-
-
Create your account
-
This is required. Continue to create your account on {{ server_name }}. You can't change this later.