1.2.6 password recovery TRI-108

This commit is contained in:
2024-09-23 16:02:27 +03:00
parent 86d78fdd06
commit b4beac26a7
5 changed files with 33 additions and 20 deletions

View File

@@ -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;
}

View File

@@ -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')
}
});
}

View File

@@ -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')
}

View File

@@ -5,9 +5,10 @@
{% trans "Пароль" as p_password %}
<section class="login">
<h1>{% translate "Войдите в профиль" %}</h1>
<h1>{% translate "Войдите в профиль" %}</h1>
<form class="login_form" name="login_form" method="post">
{% csrf_token %}
<div>
{% if form.errors.all__ %}
@@ -55,23 +56,29 @@
<form class="password_recovery" name="password_recovery" method="post">
</section>
<div class="recovery_pas">
<h1>{% translate "Введите Ваш Email" %}</h1>
<form class="password_recovery" id="password_recovery" name="password_recovery" method="post">
{% csrf_token %}
<div class="inputs_l">
<input
name="email"
type="text"
placeholder="{{ p_login }}"
placeholder={% translate "Email" %}
{% if form.data.username %} value="{{ form.data.username }}"{% endif %}
id="login_email_input"
>
{% if form.username and form.errors.username %}
<span>{{ form.errors.username }}</span>
{% endif %}
{# <div class="agree_text_l">{% translate %}</div>#}
</div>
<div class="button_register "><button class="recovery" onclick="SendLoginForm(this)">{% translate "Восстановить" %}</button></div>
<div class="button_register "><button class="recovery" onclick="SendLoginForm(this)">{% translate "Отправить ссылку для сброса пароля" %}</button></div>
</form>
</section>
</div>

View File

@@ -4,7 +4,7 @@
{% trans "Подтвердить пароль *" as p_con_password %}
<section class="register" id="confirm_password">
<h1>{% translate "Восстановление пароля" %}</h1>
<h1>{% translate "Изменение пароля" %}</h1>
<form