Activer reset du mot de passe
This commit is contained in:
parent
cf17495076
commit
086b12ef79
|
@ -113,6 +113,8 @@ STATIC_ROOT = BASE_DIR / "static"
|
||||||
|
|
||||||
LOGOUT_REDIRECT_URL = reverse_lazy("presentation")
|
LOGOUT_REDIRECT_URL = reverse_lazy("presentation")
|
||||||
|
|
||||||
|
DEFAULT_FROM_EMAIL = "webmaster@2xlibre.net"
|
||||||
|
|
||||||
# Default primary key field type
|
# Default primary key field type
|
||||||
# https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field
|
# https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
<label for="id_password" class="form-label w-100">Mot de passe</label>
|
<label for="id_password" class="form-label w-100">Mot de passe</label>
|
||||||
{{ form.password.errors }} {{ form.password }}
|
{{ form.password.errors }} {{ form.password }}
|
||||||
</div>
|
</div>
|
||||||
<!--div class="mb-4">
|
<div class="mb-4">
|
||||||
<a href="{% url 'password_reset' %}" class="text-link">Mot de passe oublié</a>
|
<a href="{% url 'password_reset' %}" class="text-link">Mot de passe oublié ?</a>
|
||||||
</div-->
|
</div>
|
||||||
<button class="btn btn-cta btn-light" type="submit">Se connecter</button>
|
<button class="btn btn-cta btn-light" type="submit">Se connecter</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
17
templates/registration/password_reset_complete.html
Normal file
17
templates/registration/password_reset_complete.html
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block breadcrumbs %}
|
||||||
|
<div class="breadcrumbs">
|
||||||
|
<a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
|
||||||
|
› {% translate 'Password reset' %}
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<p>{% translate "Your password has been set. You may go ahead and log in now." %}</p>
|
||||||
|
|
||||||
|
<p><a href="{{ login_url }}">{% translate 'Log in' %}</a></p>
|
||||||
|
|
||||||
|
{% endblock %}
|
48
templates/registration/password_reset_confirm.html
Normal file
48
templates/registration/password_reset_confirm.html
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
{% load i18n static %}
|
||||||
|
|
||||||
|
{% block title %}{% if form.new_password1.errors or form.new_password2.errors %}{% translate "Error:" %} {% endif %}{{ block.super }}{% endblock %}
|
||||||
|
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" href="{% static "admin/css/forms.css" %}">{% endblock %}
|
||||||
|
{% block breadcrumbs %}
|
||||||
|
<div class="breadcrumbs">
|
||||||
|
<a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
|
||||||
|
› {% translate 'Password reset confirmation' %}
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
{% if validlink %}
|
||||||
|
|
||||||
|
<p>{% translate "Please enter your new password twice so we can verify you typed it in correctly." %}</p>
|
||||||
|
|
||||||
|
<form method="post">{% csrf_token %}
|
||||||
|
<fieldset class="module aligned">
|
||||||
|
<input class="hidden" autocomplete="username" value="{{ form.user.get_username }}">
|
||||||
|
<div class="form-row field-password1 mt-3">
|
||||||
|
{{ form.new_password1.errors }}
|
||||||
|
<div class="flex-container">
|
||||||
|
<label for="id_new_password1">{% translate 'New password:' %}</label>
|
||||||
|
{{ form.new_password1 }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-row field-password2 mt-1">
|
||||||
|
{{ form.new_password2.errors }}
|
||||||
|
<div class="flex-container">
|
||||||
|
<label for="id_new_password2">{% translate 'Confirm password:' %}</label>
|
||||||
|
{{ form.new_password2 }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
<div class="submit-row mt-3">
|
||||||
|
<input type="submit" value="{% translate 'Change my password' %}">
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
<p>{% translate "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}</p>
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% endblock %}
|
17
templates/registration/password_reset_done.html
Normal file
17
templates/registration/password_reset_done.html
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block breadcrumbs %}
|
||||||
|
<div class="breadcrumbs">
|
||||||
|
<a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
|
||||||
|
› {% translate 'Password reset' %}
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<p>{% translate 'We’ve emailed you instructions for setting your password, if an account exists with the email you entered. You should receive them shortly.' %}</p>
|
||||||
|
|
||||||
|
<p>{% translate 'If you don’t receive an email, please make sure you’ve entered the address you registered with, and check your spam folder.' %}</p>
|
||||||
|
|
||||||
|
{% endblock %}
|
32
templates/registration/password_reset_form.html
Normal file
32
templates/registration/password_reset_form.html
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
{% load i18n static %}
|
||||||
|
|
||||||
|
{% block title %}{% if form.email.errors %}{% translate "Error:" %} {% endif %}{{ block.super }}{% endblock %}
|
||||||
|
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" href="{% static "admin/css/forms.css" %}">{% endblock %}
|
||||||
|
{% block breadcrumbs %}
|
||||||
|
<div class="breadcrumbs">
|
||||||
|
<a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
|
||||||
|
› {% translate 'Password reset' %}
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<p>{% translate 'Forgotten your password? Enter your email address below, and we’ll email instructions for setting a new one.' %}</p>
|
||||||
|
|
||||||
|
<form method="post">{% csrf_token %}
|
||||||
|
<fieldset class="module aligned mt-3">
|
||||||
|
<div class="form-row field-email">
|
||||||
|
{{ form.email.errors }}
|
||||||
|
<div class="flex-container">
|
||||||
|
<label for="id_email">{% translate 'Email address:' %}</label>
|
||||||
|
{{ form.email }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
<div class="submit-row mt-3">
|
||||||
|
<input type="submit" value="{% translate 'Reset my password' %}">
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{% endblock %}
|
Loading…
Reference in a new issue