diff --git a/static/css/styles.css b/static/css/styles.css index f1a5a3b..7dae002 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -1219,7 +1219,7 @@ section.login { margin-bottom: 120px; } -section.login>h1 { +section.login>h1, div.recovery_pas>h1 { color: #272424; text-align: center; /* Heading 1 */ @@ -1231,7 +1231,7 @@ section.login>h1 { margin-bottom: 40px; } -section.login>form { +section.login>form, div.recovery_pas>form { max-width: 420px; margin: auto; text-align: center; @@ -3366,16 +3366,20 @@ details[open] summary ~ *{ /*END news articles all*/ -.login_form.hide{ +.login.hide{ display: none; } -.password_recovery{ +.recovery_pas{ display: none; } -.password_recovery.show{ +.recovery_pas.show{ display: block; } +.recovery.hide{ + display: none; +} + diff --git a/static/js/authorization.js b/static/js/authorization.js index da0a6c3..0c59dfe 100644 --- a/static/js/authorization.js +++ b/static/js/authorization.js @@ -9,6 +9,7 @@ function SendLoginForm(el){ let msr = sessionStorage.getItem('mailingSubscribeRequired') formData.set('mailingSubscribeRequired',msr) } + document.getElementsByClassName('recovery')[0].classList.add('hide') @@ -25,20 +26,21 @@ function SendLoginForm(el){ success: function(data){ - location.href = data.redirect_url//`/profile/page/dashboard/` - window.sessionStorage.removeItem('mailingSubscribeRequired') - window.sessionStorage.removeItem('email') - - - - + if(url === '/user_account/login/'){ + location.href = data.redirect_url//`/profile/page/dashboard/` + window.sessionStorage.removeItem('mailingSubscribeRequired') + window.sessionStorage.removeItem('email') + } else if(url === '/user_account/password_recovery/'){ + document.getElementById('password_recovery').innerHTML = data.message + } }, error: function (data, exception){ document.querySelector(".login").innerHTML = data.responseJSON.html + document.getElementsByClassName('recovery')[0].classList.remove('hide') } }); } diff --git a/static/js/user_profile.js b/static/js/user_profile.js index 02fcba0..037a976 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -1396,8 +1396,8 @@ function showTabBtn(el) { } function showForm(){ - let hide_form = document.getElementsByClassName('login_form') - let show_form = document.getElementsByClassName('password_recovery') + let hide_form = document.getElementsByClassName('login') + let show_form = document.getElementsByClassName('recovery_pas') hide_form[0].classList.add('hide') show_form[0].classList.add('show') } diff --git a/templates/forms/f_login.html b/templates/forms/f_login.html index f035b5f..d46b8dc 100644 --- a/templates/forms/f_login.html +++ b/templates/forms/f_login.html @@ -5,9 +5,10 @@ {% trans "Пароль" as p_password %}
-

{% translate "Войдите в профиль" %}

+

{% translate "Войдите в профиль" %}

+ {% csrf_token %}
{% if form.errors.all__ %} @@ -55,23 +56,29 @@ - + +
+ +
+

{% translate "Введите Ваш Email" %}

+ {% csrf_token %}
{% if form.username and form.errors.username %} {{ form.errors.username }} {% endif %} +{#
{% translate %}
#}
-
+
- \ No newline at end of file +
\ No newline at end of file diff --git a/templates/forms/f_password_recovery.html b/templates/forms/f_password_recovery.html index 6e19556..7071bef 100644 --- a/templates/forms/f_password_recovery.html +++ b/templates/forms/f_password_recovery.html @@ -4,7 +4,7 @@ {% trans "Подтвердить пароль *" as p_con_password %}
-

{% translate "Восстановление пароля" %}

+

{% translate "Изменение пароля" %}