Refactor password confirm form
This commit is contained in:
parent
3ea359ff8a
commit
abd757f571
1 changed files with 7 additions and 24 deletions
|
|
@ -2,34 +2,18 @@
|
|||
{% load static i18n %}
|
||||
|
||||
{% block meta %}
|
||||
<!-- NOTE(joshblum): This prevents leaking the password reset token via the
|
||||
Referer header to any 3rd party apps on the page. -->
|
||||
<meta name="referrer" content="origin">
|
||||
<!-- NOTE(joshblum): This prevents leaking the password reset token via the
|
||||
Referer header to any 3rd party apps on the page. -->
|
||||
<meta name="referrer" content="origin">
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}{% trans "Confirm password reset" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<main class="main">
|
||||
|
||||
{% if validlink %}
|
||||
<form class="form password-reset-confirm-form" method="POST">
|
||||
{% csrf_token %}
|
||||
<div class="form__header">
|
||||
<h1 class="form__title">
|
||||
{% trans "Enter your new password below to reset your password:" %}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<fieldset class="fieldset password-reset-form__fieldset">
|
||||
{{ form }}
|
||||
</fieldset>
|
||||
<fieldset class="fieldset password-reset-form__fieldset">
|
||||
<a class="button button--cancel" href="{% url 'accounts:login' %}">Cancel</a>
|
||||
<button class="button button--confirm" type="submit">Change password</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
{% url 'accounts:login' as cancel_url %}
|
||||
{% trans "Enter your new password below to reset your password:" as title %}
|
||||
{% trans "Change password" as confirm_text %}
|
||||
{% include "components/form/form.html" with form=form title=title confirm_text=confirm_text cancel_url=cancel_url %}
|
||||
{% else %}
|
||||
<div class="card">
|
||||
<div class="card__header">
|
||||
|
|
@ -51,5 +35,4 @@
|
|||
</main>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{# This is used by django.contrib.auth #}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue