1.2.6 password recovery TRI-108
This commit is contained in:
@@ -1219,7 +1219,7 @@ section.login {
|
|||||||
margin-bottom: 120px;
|
margin-bottom: 120px;
|
||||||
}
|
}
|
||||||
|
|
||||||
section.login>h1 {
|
section.login>h1, div.recovery_pas>h1 {
|
||||||
color: #272424;
|
color: #272424;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
/* Heading 1 */
|
/* Heading 1 */
|
||||||
@@ -1231,7 +1231,7 @@ section.login>h1 {
|
|||||||
margin-bottom: 40px;
|
margin-bottom: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
section.login>form {
|
section.login>form, div.recovery_pas>form {
|
||||||
max-width: 420px;
|
max-width: 420px;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -3366,16 +3366,20 @@ details[open] summary ~ *{
|
|||||||
|
|
||||||
/*END news articles all*/
|
/*END news articles all*/
|
||||||
|
|
||||||
.login_form.hide{
|
.login.hide{
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.password_recovery{
|
.recovery_pas{
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.password_recovery.show{
|
.recovery_pas.show{
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.recovery.hide{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ function SendLoginForm(el){
|
|||||||
let msr = sessionStorage.getItem('mailingSubscribeRequired')
|
let msr = sessionStorage.getItem('mailingSubscribeRequired')
|
||||||
formData.set('mailingSubscribeRequired',msr)
|
formData.set('mailingSubscribeRequired',msr)
|
||||||
}
|
}
|
||||||
|
document.getElementsByClassName('recovery')[0].classList.add('hide')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -25,20 +26,21 @@ function SendLoginForm(el){
|
|||||||
success: function(data){
|
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){
|
error: function (data, exception){
|
||||||
document.querySelector(".login").innerHTML = data.responseJSON.html
|
document.querySelector(".login").innerHTML = data.responseJSON.html
|
||||||
|
document.getElementsByClassName('recovery')[0].classList.remove('hide')
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1396,8 +1396,8 @@ function showTabBtn(el) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function showForm(){
|
function showForm(){
|
||||||
let hide_form = document.getElementsByClassName('login_form')
|
let hide_form = document.getElementsByClassName('login')
|
||||||
let show_form = document.getElementsByClassName('password_recovery')
|
let show_form = document.getElementsByClassName('recovery_pas')
|
||||||
hide_form[0].classList.add('hide')
|
hide_form[0].classList.add('hide')
|
||||||
show_form[0].classList.add('show')
|
show_form[0].classList.add('show')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,9 +5,10 @@
|
|||||||
{% trans "Пароль" as p_password %}
|
{% trans "Пароль" as p_password %}
|
||||||
|
|
||||||
<section class="login">
|
<section class="login">
|
||||||
<h1>{% translate "Войдите в профиль" %}</h1>
|
<h1>{% translate "Войдите в профиль" %}</h1>
|
||||||
|
|
||||||
<form class="login_form" name="login_form" method="post">
|
<form class="login_form" name="login_form" method="post">
|
||||||
|
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div>
|
<div>
|
||||||
{% if form.errors.all__ %}
|
{% 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 %}
|
{% csrf_token %}
|
||||||
|
|
||||||
<div class="inputs_l">
|
<div class="inputs_l">
|
||||||
<input
|
<input
|
||||||
name="email"
|
name="email"
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="{{ p_login }}"
|
placeholder={% translate "Email" %}
|
||||||
{% if form.data.username %} value="{{ form.data.username }}"{% endif %}
|
{% if form.data.username %} value="{{ form.data.username }}"{% endif %}
|
||||||
id="login_email_input"
|
id="login_email_input"
|
||||||
>
|
>
|
||||||
{% if form.username and form.errors.username %}
|
{% if form.username and form.errors.username %}
|
||||||
<span>{{ form.errors.username }}</span>
|
<span>{{ form.errors.username }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{# <div class="agree_text_l">{% translate %}</div>#}
|
||||||
</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>
|
</form>
|
||||||
</section>
|
</div>
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
{% trans "Подтвердить пароль *" as p_con_password %}
|
{% trans "Подтвердить пароль *" as p_con_password %}
|
||||||
|
|
||||||
<section class="register" id="confirm_password">
|
<section class="register" id="confirm_password">
|
||||||
<h1>{% translate "Восстановление пароля" %}</h1>
|
<h1>{% translate "Изменение пароля" %}</h1>
|
||||||
|
|
||||||
|
|
||||||
<form
|
<form
|
||||||
|
|||||||
Reference in New Issue
Block a user