63 lines
2.7 KiB
HTML
63 lines
2.7 KiB
HTML
{% extends 'base.html' %}
|
||
|
||
{% block title %}Сброс пароля{% endblock %}
|
||
|
||
{% block content %}
|
||
<div class="container d-flex align-items-center justify-content-center" style="min-height: 70vh;">
|
||
<div class="card shadow-sm" style="max-width: 420px; width: 100%;">
|
||
<div class="card-body p-4">
|
||
<!-- Заголовок -->
|
||
<div class="text-center mb-4">
|
||
<h3 class="fw-bold mb-2">Сброс пароля</h3>
|
||
<p class="text-muted mb-0">Введите новый пароль</p>
|
||
</div>
|
||
|
||
<!-- Сообщения -->
|
||
{% if messages %}
|
||
{% for message in messages %}
|
||
<div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
|
||
{{ message }}
|
||
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
||
</div>
|
||
{% endfor %}
|
||
{% endif %}
|
||
|
||
<!-- Форма сброса пароля -->
|
||
<form method="post">
|
||
{% csrf_token %}
|
||
{% include 'accounts/password_input.html' with field_name='password1' field_label='Новый пароль' required=True %}
|
||
{% include 'accounts/password_input.html' with field_name='password2' field_label='Подтверждение пароля' required=True %}
|
||
<button type="submit" class="btn btn-primary w-100 py-2 mb-3">Сбросить пароль</button>
|
||
|
||
<!-- Ссылка на вход -->
|
||
<div class="text-center">
|
||
<a href="{% url 'accounts:login' %}" class="text-decoration-none text-muted">
|
||
<small>Вспомнили пароль? Войти</small>
|
||
</a>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<script>
|
||
// Добавляем обработчик для показа/скрытия пароля
|
||
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.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');
|
||
}
|
||
});
|
||
});
|
||
</script>
|
||
{% endblock %} |