feat: implement user authentication features (registration, activation, and password reset)
All checks were successful
Build and Push Docker Image / build (push) Successful in 46s
All checks were successful
Build and Push Docker Image / build (push) Successful in 46s
- Added email templates for activation and password reset (`activation_email.html`, `password_reset_email.html`, etc.) - Created forms for registration (`RegisterForm`) and login (`LoginForm`) with custom validation - Developed new pages for account activation (`activation_success.html`, `activation_invalid.html`), password reset workflow, and profile - Configured email backend and environment file handling in settings - Updated header template to conditionally display profile or login links based on authentication status - Enhanced CSS styles for authentication-related pages and forms
This commit is contained in:
@@ -8,32 +8,76 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="full-page">
|
||||
<div class="auth-page">
|
||||
{% include "_fragments/header.html" %}
|
||||
|
||||
<div class="center-wrapper">
|
||||
<form class="login-form" action="">
|
||||
<h2>ВХОД</h2>
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="login">Логин</label>
|
||||
<input class="form-input" type="text" id="login">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="password">Пароль</label>
|
||||
<input class="form-input" type="password" id="password">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<input class="form-input" type="checkbox" id="persist">
|
||||
<label class="form-label" for="persist">Оставаться в системе</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit">Войти</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<main class="auth-section">
|
||||
<div class="container auth-layout">
|
||||
<section class="auth-intro auth-intro--login">
|
||||
<p class="auth-kicker">Личный кабинет</p>
|
||||
<h1 id="login-title" class="auth-title">Вход в аккаунт</h1>
|
||||
<p class="auth-description">
|
||||
Войдите, чтобы управлять заказами, сохранять избранные товары и быстрее оформлять покупки.
|
||||
</p>
|
||||
<a class="auth-side-link" href="/catalog/">Перейти в каталог</a>
|
||||
</section>
|
||||
|
||||
<section class="auth-panel" aria-labelledby="login-title">
|
||||
<form class="auth-form" action="" method="post">
|
||||
{% csrf_token %}
|
||||
{% if form.non_field_errors %}
|
||||
<div class="auth-alert auth-alert--error">
|
||||
{% for error in form.non_field_errors %}
|
||||
<p>{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="auth-field">
|
||||
<label for="{{ form.email.id_for_label }}">Электронная почта</label>
|
||||
<input
|
||||
id="{{ form.email.id_for_label }}"
|
||||
name="{{ form.email.html_name }}"
|
||||
type="email"
|
||||
value="{{ form.email.value|default:'' }}"
|
||||
placeholder="example@mail.ru"
|
||||
autocomplete="email"
|
||||
>
|
||||
{% for error in form.email.errors %}
|
||||
<p class="auth-field-error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="auth-field">
|
||||
<label for="{{ form.password.id_for_label }}">Пароль</label>
|
||||
<input
|
||||
id="{{ form.password.id_for_label }}"
|
||||
name="{{ form.password.html_name }}"
|
||||
type="password"
|
||||
placeholder="Введите пароль"
|
||||
autocomplete="current-password"
|
||||
>
|
||||
{% for error in form.password.errors %}
|
||||
<p class="auth-field-error">{{ error }}</p>
|
||||
{% endfor %}
|
||||
<a class="auth-secondary-link" href="{% url 'users:password_reset' %}">Сбросить пароль</a>
|
||||
</div>
|
||||
|
||||
<div class="auth-actions">
|
||||
<div class="auth-buttons">
|
||||
<button class="auth-submit" type="submit">Войти</button>
|
||||
|
||||
</div>
|
||||
<p class="auth-switch">
|
||||
Нет аккаунта?
|
||||
<a href="{% url 'users:register' %}">Зарегистрироваться</a>
|
||||
</p>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
{% include "_fragments/footer.html" %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user