From c842a8adae2bd1846e98216886ac66e469b99f08 Mon Sep 17 00:00:00 2001 From: Tudor Amariei Date: Fri, 20 Dec 2024 11:00:14 +0200 Subject: [PATCH] update the set-password page --- backend/donations/views/account_management.py | 4 +- backend/templates/v1/parola-noua.html | 55 ------------------- .../v2/account/components/password-input.html | 23 ++++++++ .../templates/v2/account/set-password.html | 51 +++++++++++++++++ 4 files changed, 76 insertions(+), 57 deletions(-) delete mode 100644 backend/templates/v1/parola-noua.html create mode 100644 backend/templates/v2/account/components/password-input.html create mode 100644 backend/templates/v2/account/set-password.html diff --git a/backend/donations/views/account_management.py b/backend/donations/views/account_management.py index ecf76803..316a789f 100644 --- a/backend/donations/views/account_management.py +++ b/backend/donations/views/account_management.py @@ -154,7 +154,7 @@ def get(self, request, *args, **kwargs): class SetPasswordView(BaseVisibleTemplateView): - template_name = "parola-noua.html" + template_name = "account/set-password.html" title = _("Set New Password") def post(self, request, *args, **kwargs): @@ -279,7 +279,7 @@ class VerificationView(BaseVisibleTemplateView): p - reset user password """ - template_name = "parola-noua.html" + template_name = "account/set-password.html" title = _("Verification") def get(self, request, *args, **kwargs): diff --git a/backend/templates/v1/parola-noua.html b/backend/templates/v1/parola-noua.html deleted file mode 100644 index 90f670b5..00000000 --- a/backend/templates/v1/parola-noua.html +++ /dev/null @@ -1,55 +0,0 @@ - -{% extends "base.html" %} - - -{% block additional_headers %} - -{% endblock %} - - -{% block content %} -
- -
- {% if errors %} -
-
- - Oops! {{ errors }} -
-
- {% endif %} -
- -
-
-
- {{ csrf_input }} -
- Resetare parolă - - -
- -
-
- -
-
-
- -
-
-
-
-
-
- -
- -
-{% endblock %} - -{% block scripts %} - -{% endblock %} diff --git a/backend/templates/v2/account/components/password-input.html b/backend/templates/v2/account/components/password-input.html new file mode 100644 index 00000000..2e01f0ff --- /dev/null +++ b/backend/templates/v2/account/components/password-input.html @@ -0,0 +1,23 @@ +{% load i18n %} + +{% if not field_label %} + {% trans "Password" as field_label %} +{% endif %} + +
+ +
diff --git a/backend/templates/v2/account/set-password.html b/backend/templates/v2/account/set-password.html new file mode 100644 index 00000000..26ed18ad --- /dev/null +++ b/backend/templates/v2/account/set-password.html @@ -0,0 +1,51 @@ +{% extends "account/base.html" %} +{% load i18n static %} + +{% block head_title %} + {{ title }} +{% endblock head_title %} + +{% block additional_headers %} + +{% endblock %} + +{% block content %} + +
+ +
+
+

+ {% trans "Set a new password" %} +

+
+ + {% csrf_token %} + +
+
+ + + + {% trans "New password" as password_label %} + {% trans "Confirm password" as password_confirm_label %} + + {% include "account/components/password-input.html" with field_label=password_label input_name="password" password_type="new" %} + + {% include "account/components/password-input.html" with field_label=password_confirm_label input_name="password_confirm" password_type="new" %} + + + +
+
+
+ +
+ +
+ +{% endblock %}