From 61da0683bd35663366512518661cbaeec742438e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Tue, 21 May 2024 17:17:48 +0200 Subject: [PATCH] feat: more blocks for theming login and password pages --- canaille/core/templates/login.html | 58 +++++++++++++++------------ canaille/core/templates/password.html | 54 ++++++++++++++----------- 2 files changed, 64 insertions(+), 48 deletions(-) diff --git a/canaille/core/templates/login.html b/canaille/core/templates/login.html index f50f43ee..ac181aba 100644 --- a/canaille/core/templates/login.html +++ b/canaille/core/templates/login.html @@ -7,37 +7,45 @@
- {% if logo_url %} - - {{ website_name }} - - {% else %} - - {% endif %} + {% block header %} + {% if logo_url %} + + {{ website_name }} + + {% else %} + + {% endif %} -

-
- {{ _("Sign in at %(website)s", website=website_name) }} -
-
{% trans %}Manage your information and your authorizations{% endtrans %}
-

+

+
+ {{ _("Sign in at %(website)s", website=website_name) }} +
+
{% trans %}Manage your information and your authorizations{% endtrans %}
+

+ {% endblock %} - {{ flask.messages() }} + {% block messages %} + {{ flask.messages() }} + {% endblock %} {% call fui.render_form(form) %} - {% block login_field scoped %}{{ login_field.render_field(form.login, class="autofocus") }}{% endblock %} + {% block fields %} + {% block login_field scoped %}{{ login_field.render_field(form.login, class="autofocus") }}{% endblock %} + {% endblock %} -
-
- {% if features.has_registration %} - {{ _("Create an account") }} - {% endif %} - {% if features.has_smtp and features.has_password_recovery %} - {{ _("Forgotten password") }} - {% endif %} - + {% block buttons %} +
+
+ {% if features.has_registration %} + {{ _("Create an account") }} + {% endif %} + {% if features.has_smtp and features.has_password_recovery %} + {{ _("Forgotten password") }} + {% endif %} + +
-
+ {% endblock %} {% endcall %}
diff --git a/canaille/core/templates/password.html b/canaille/core/templates/password.html index 40fc1a1d..13a027b0 100644 --- a/canaille/core/templates/password.html +++ b/canaille/core/templates/password.html @@ -7,35 +7,43 @@
- {% if logo_url %} - - {{ website_name }} - - {% else %} - - {% endif %} + {% block header %} + {% if logo_url %} + + {{ website_name }} + + {% else %} + + {% endif %} -

-
- {{ _("Sign in as %(username)s", username=username) }} -
-
{% trans %}Please enter your password for this account.{% endtrans %}
-

+

+
+ {{ _("Sign in as %(username)s", username=username) }} +
+
{% trans %}Please enter your password for this account.{% endtrans %}
+

+ {% endblock %} - {{ flask.messages() }} + {% block messages %} + {{ flask.messages() }} + {% endblock %} {% call fui.render_form(form, hx_boost="false") %} - {{ login_field.render_field(form.password, class="autofocus") }} + {% block fields %} + {{ login_field.render_field(form.password, class="autofocus") }} + {% endblock %} -
-
- {{ _("I am not %(username)s", username=username) }} - {% if features.has_smtp and features.has_password_recovery %} - {{ _("Forgotten password") }} - {% endif %} - + {% block buttons %} +
+
+ {{ _("I am not %(username)s", username=username) }} + {% if features.has_smtp and features.has_password_recovery %} + {{ _("Forgotten password") }} + {% endif %} + +
-
+ {% endblock %} {% endcall %}