feat: custom forms for accounts
This commit is contained in:
@ -24,6 +24,13 @@
|
||||
{{ user.email }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-start">
|
||||
<div class="col">
|
||||
</div>
|
||||
<div class="col">
|
||||
<a href="{% url 'password_change' %}">Сменить пароль</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p> </p>
|
||||
<div class="container">
|
||||
|
@ -1,5 +1,6 @@
|
||||
{% autoescape off %}
|
||||
Привет, {{ user.username }}.
|
||||
|
||||
Ссылка для активации аккаунта:
|
||||
https://{{ domain }}{% url 'activate' uidb64=uid token=token %}
|
||||
{% endautoescape %}
|
@ -5,8 +5,14 @@
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button class="btn btn-primary text-uppercase" type="submit">Войти</button>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="p-2">
|
||||
<button class="btn btn-primary text-uppercase" type="submit">Войти</button>
|
||||
</div>
|
||||
<div class="p-2">
|
||||
<a href={% url 'password_reset' %} class="btn btn-primary text-uppercase">Забыл пароль</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<br />
|
||||
{% endblock %}
|
||||
|
||||
|
6
later42/templates/registration/password_change_done.html
Normal file
6
later42/templates/registration/password_change_done.html
Normal file
@ -0,0 +1,6 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<p>Пароль успешно изменен.</p>
|
||||
<p>Перейти в <a href="{% url 'profile' %}">Профиль</a>.</p>
|
||||
{% endblock %}
|
14
later42/templates/registration/password_change_form.html
Normal file
14
later42/templates/registration/password_change_form.html
Normal file
@ -0,0 +1,14 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block content %}
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="card-title">Смена пароля</h4>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="btn btn-primary btn-block">Сменить</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
@ -0,0 +1,6 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<p>Пароль успешно изменен.</p>
|
||||
<p>Вы можете <a href="{% url 'login' %}">войти</a>.</p>
|
||||
{% endblock %}
|
32
later42/templates/registration/password_reset_confirm.html
Normal file
32
later42/templates/registration/password_reset_confirm.html
Normal file
@ -0,0 +1,32 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
{% if validlink %}
|
||||
<p>Введите новый пароль.</p>
|
||||
<form action="" method="post">
|
||||
<div style="display:none">
|
||||
<input type="hidden" value="{{ csrf_token }}" name="csrfmiddlewaretoken">
|
||||
</div>
|
||||
<table>
|
||||
<tr>
|
||||
<td>{{ form.new_password1.errors }}
|
||||
<label for="id_new_password1">Новый пароль:</label></td>
|
||||
<td>{{ form.new_password1 }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ form.new_password2.errors }}
|
||||
<label for="id_new_password2">Подтверждение:</label></td>
|
||||
<td>{{ form.new_password2 }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type="submit" value="Сменить" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
{% else %}
|
||||
<h1>Сброс пароля прошел неудачно</h1>
|
||||
<p>Ссылка неверная или уже была использована.<br />
|
||||
Попробуйте сбросить пароль еще раз.</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
6
later42/templates/registration/password_reset_done.html
Normal file
6
later42/templates/registration/password_reset_done.html
Normal file
@ -0,0 +1,6 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<p>Сообщение успешно отправлено.</p>
|
||||
<p>Вы должны получить его в скором времени.</p>
|
||||
{% endblock %}
|
14
later42/templates/registration/password_reset_form.html
Normal file
14
later42/templates/registration/password_reset_form.html
Normal file
@ -0,0 +1,14 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block content %}
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="card-title">Reset your password</h4>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit" class="btn btn-primary btn-block">Reset</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user