From 38e8ae6a273e3ee3e634fa204c384b70343cd849 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson <frjo@xdeb.org> Date: Wed, 23 Jan 2019 11:22:13 +0100 Subject: [PATCH] Display password rules and errors on the password reset form. --- .../users/password_reset/confirm.html | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/opentech/apply/users/templates/users/password_reset/confirm.html b/opentech/apply/users/templates/users/password_reset/confirm.html index 50804505a..71cf2fbf6 100644 --- a/opentech/apply/users/templates/users/password_reset/confirm.html +++ b/opentech/apply/users/templates/users/password_reset/confirm.html @@ -4,10 +4,31 @@ {% block page_title %}Set your new password{% endblock %} {% block content %} <div class="wrapper wrapper--small wrapper--bottom-space"> - <form class="form form--with-p-tags" method="post" novalidate> + <form class="form" method="post" novalidate> + {% if form.non_field_errors %} + <ul class="errorlist"> + {% for error in form.non_field_errors %} + <li>{{ error }}</li> + {% endfor %} + </ul> + {% endif %} + + {% if form.errors %} + <ul class="errorlist"> + {% blocktrans count counter=form.errors.items|length %} + <li>Please correct the error below.</li> + {% plural %} + <li>Please correct the errors below.</li> + {% endblocktrans %} + </ul> + {% endif %} + {% csrf_token %} - <p>{{ form.new_password1.label_tag }} {{ form.new_password1 }}</p> - <p>{{ form.new_password2.label_tag }} {{ form.new_password2 }}</p> + + {% for field in form %} + {% include "forms/includes/field.html" %} + {% endfor %} + <button class="link link--button-secondary" type="submit">{% trans 'Reset password' %}</button> </form> </div> -- GitLab