add password reset

This commit is contained in:
2021-03-06 01:43:07 -08:00
parent f9f8bf13ac
commit 5d6ae12550
7 changed files with 117 additions and 1 deletions

View File

@ -0,0 +1,13 @@
{% extends "base.html" %}
{% load i18n %}
{% block content %}
{% include "base_navbar.html" %}
{% include "base_heading.html" %}
<div class="d-flex flex-column align-items-center">
<p class="text-justify px-3">{% translate 'Weve emailed you instructions for setting your password, if an account exists with the email you entered. You should receive them shortly.' %}</p>
<p class="text-justify px-3">{% translate 'If you dont receive an email, please make sure youve entered the address you registered with, and check your spam folder.' %}</p>
</div>
{% endblock %}

View File

@ -0,0 +1,13 @@
{% extends "base.html" %}
{% load i18n %}
{% block content %}
{% include "base_navbar.html" %}
{% include "base_heading.html" %}
<p class="text-center">{% translate "Your password has been set." %}</p>
<p class="text-center">{% translate "You may go ahead and log in now." %}</p>
<p class="text-center"><a href="{{ login_url }}">{% translate 'Log in' %}</a></p>
{% endblock %}

View File

@ -0,0 +1,14 @@
{% load i18n %}{% autoescape off %}
{% blocktranslate %}You're receiving this email because you requested a password reset for your user account at {{ site_name }}.{% endblocktranslate %}
{% translate "Please go to the following page and choose a new password:" %}
{% block reset_link %}
{{ protocol }}://{{ domain }}{% url 'accounts:password_reset_confirm' uidb64=uid token=token %}
{% endblock %}
{% translate 'Your username, in case youve forgotten:' %} {{ user.get_username }}
{% translate "Thanks for using our site!" %}
{% blocktranslate %}The {{ site_name }} team{% endblocktranslate %}
{% endautoescape %}

View File

@ -0,0 +1,40 @@
{% extends "base.html" %}
{% load i18n static %}
{% load crispy_forms_tags %}
{% block content %}
{% include "base_navbar.html" %}
{% if validlink %}
<div class="container">
<div class="row justify-content-center my-2 mx-0">
<h1 class="text-center">Enter New Password</h1>
</div>
</div>
<div class="container">
<div class="d-flex flex-column offset-sm-3 col-sm-6 col-xs-12 px-0">
<form method="POST">
{% csrf_token %}
{{ form | crispy }}
<div class="mt-3">
<input type="submit" class="btn btn-dark btn-lg" value="Change My Password">
</div>
</form>
</div>
</div>
{% else %}
<div class="container">
<div class="row justify-content-center my-2 mx-0">
<h1 class="text-center">Error</h1>
</div>
</div>
<p class="text-center">{% translate "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}</p>
{% endif %}
{% endblock %}