From 835d6020e2a7b2f40b7071bf18a814a4c386a600 Mon Sep 17 00:00:00 2001 From: Andrey Smakotin Date: Sun, 14 Dec 2025 01:56:50 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BA=D0=BB=D1=8E=D1=87=D0=B0?= =?UTF-8?q?=D1=82=D0=B5=D0=BB=D1=8C=20=D0=B2=D0=B8=D0=B4=D0=B8=D0=BC=D0=BE?= =?UTF-8?q?=D1=81=D1=82=D0=B8=20=D0=BF=D0=B0=D1=80=D0=BE=D0=BB=D1=8F=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=B2=D1=81=D0=B5=D1=85=20=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D1=86=D0=B0=D1=85=20=D0=B2=D1=85=D0=BE=D0=B4?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- myproject/accounts/static/accounts/js/auth.js | 25 +++++++++++++++++++ .../accounts/password_reset_confirm.html | 21 ---------------- .../accounts/password_setup_confirm.html | 21 ---------------- myproject/templates/base.html | 3 +++ myproject/templates/change_password.html | 21 ---------------- myproject/templates/home.html | 5 +--- 6 files changed, 29 insertions(+), 67 deletions(-) create mode 100644 myproject/accounts/static/accounts/js/auth.js diff --git a/myproject/accounts/static/accounts/js/auth.js b/myproject/accounts/static/accounts/js/auth.js new file mode 100644 index 0000000..b926cf1 --- /dev/null +++ b/myproject/accounts/static/accounts/js/auth.js @@ -0,0 +1,25 @@ +// Authentication-related JavaScript functionality + +// Password visibility toggle handler +document.addEventListener('DOMContentLoaded', function() { + // Add click handlers to all password toggle buttons + document.querySelectorAll('.show-password-btn').forEach(button => { + button.addEventListener('click', function() { + const targetId = this.getAttribute('data-target'); + const targetInput = document.getElementById(targetId); + const icon = this.querySelector('i'); + + if (targetInput && icon) { + if (targetInput.type === 'password') { + targetInput.type = 'text'; + icon.classList.remove('bi-eye'); + icon.classList.add('bi-eye-slash'); + } else { + targetInput.type = 'password'; + icon.classList.remove('bi-eye-slash'); + icon.classList.add('bi-eye'); + } + } + }); + }); +}); diff --git a/myproject/accounts/templates/accounts/password_reset_confirm.html b/myproject/accounts/templates/accounts/password_reset_confirm.html index 1af9244..f5d67d0 100644 --- a/myproject/accounts/templates/accounts/password_reset_confirm.html +++ b/myproject/accounts/templates/accounts/password_reset_confirm.html @@ -39,25 +39,4 @@ - - {% endblock %} \ No newline at end of file diff --git a/myproject/accounts/templates/accounts/password_setup_confirm.html b/myproject/accounts/templates/accounts/password_setup_confirm.html index 894ea4b..a7e4af2 100644 --- a/myproject/accounts/templates/accounts/password_setup_confirm.html +++ b/myproject/accounts/templates/accounts/password_setup_confirm.html @@ -32,25 +32,4 @@ - - {% endblock %} diff --git a/myproject/templates/base.html b/myproject/templates/base.html index 56e56fa..1e0304a 100644 --- a/myproject/templates/base.html +++ b/myproject/templates/base.html @@ -54,6 +54,9 @@ + + + {% block extra_js %}{% endblock %} \ No newline at end of file diff --git a/myproject/templates/change_password.html b/myproject/templates/change_password.html index 275b7eb..d3dd4fa 100644 --- a/myproject/templates/change_password.html +++ b/myproject/templates/change_password.html @@ -32,25 +32,4 @@ - - {% endblock %} \ No newline at end of file diff --git a/myproject/templates/home.html b/myproject/templates/home.html index 6cfa088..2f1f110 100644 --- a/myproject/templates/home.html +++ b/myproject/templates/home.html @@ -31,10 +31,7 @@ -
- - -
+ {% include 'accounts/password_input.html' with field_name='password' field_label='Пароль' required=True %}