# HG changeset patch # User Brian Neal # Date 1469066076 18000 # Node ID dd57bacde96146710d0209d2ab5f4dd9cb79d342 # Parent 85119508e0721dcb58fe00b74c92f73201b94b05 Convert password reset to v3 design. diff -r 85119508e072 -r dd57bacde961 accounts/urls.py --- a/accounts/urls.py Tue Jul 19 21:20:44 2016 -0500 +++ b/accounts/urls.py Wed Jul 20 20:54:36 2016 -0500 @@ -41,24 +41,34 @@ name='accounts-password_change'), url(r'^password/reset/$', auth_views.password_reset, - kwargs={'template_name': 'accounts/password_reset.html', - 'email_template_name': 'accounts/password_reset_email.txt', - 'post_reset_redirect': '/accounts/password/reset/sent/'}, + kwargs={ + 'template_name': 'accounts/password_reset.html', + 'email_template_name': 'accounts/password_reset_email.txt', + 'post_reset_redirect': '/accounts/password/reset/sent/', + 'extra_context': {'V3_DESIGN': True}, + }, name='accounts-password_reset'), url(r'^password/reset/sent/$', auth_views.password_reset_done, - kwargs={'template_name': 'accounts/password_reset_sent.html'}, + kwargs={ + 'template_name': 'accounts/password_reset_sent.html', + 'extra_context': {'V3_DESIGN': True}, + }, name='accounts-password_reset_sent'), - url(r'^password/reset/confirm/(?P[0-9A-Za-z_\-]+)/(?P[0-9a-z]+-\w+)/$', + url(r'^password/reset/confirm/(?P[0-9A-Za-z_\-]+)/(?P[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', auth_views.password_reset_confirm, kwargs={ 'template_name': 'accounts/password_reset_confirm.html', 'post_reset_redirect': '/accounts/password/reset/success/', - }, + 'extra_context': {'V3_DESIGN': True}, + }, name='accounts-password_reset_confirm'), url(r'^password/reset/success/$', auth_views.password_reset_complete, - kwargs={'template_name': 'accounts/password_reset_complete.html'}, + kwargs={ + 'template_name': 'accounts/password_reset_complete.html', + 'extra_context': {'V3_DESIGN': True}, + }, name='accounts-password_reset_success'), url(r'^username/query/$', accounts.views.username_query, diff -r 85119508e072 -r dd57bacde961 sg101/templates/accounts/password_reset.html --- a/sg101/templates/accounts/password_reset.html Tue Jul 19 21:20:44 2016 -0500 +++ b/sg101/templates/accounts/password_reset.html Wed Jul 20 20:54:36 2016 -0500 @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'v3/base.html' %} {% block title %}Reset Password{% endblock %} {% block content %}

Reset Password

@@ -6,10 +6,15 @@ send you instructions on how to reset it.

{% csrf_token %} - -{{ form.as_table }} - -
  -
+ {{ form.non_field_errors }} + {{ form.email.errors }} +
+
+ +
+
+
{% endblock %} diff -r 85119508e072 -r dd57bacde961 sg101/templates/accounts/password_reset_complete.html --- a/sg101/templates/accounts/password_reset_complete.html Tue Jul 19 21:20:44 2016 -0500 +++ b/sg101/templates/accounts/password_reset_complete.html Wed Jul 20 20:54:36 2016 -0500 @@ -1,8 +1,9 @@ -{% extends 'base.html' %} +{% extends 'v3/base.html' %} {% block title %}Password Reset Complete{% endblock %} {% block content %}

Password Reset Complete

-

-Your password has been successfully changed. You may now login. -

+
+ Your password has been successfully changed. + You may now login. +
{% endblock %} diff -r 85119508e072 -r dd57bacde961 sg101/templates/accounts/password_reset_confirm.html --- a/sg101/templates/accounts/password_reset_confirm.html Tue Jul 19 21:20:44 2016 -0500 +++ b/sg101/templates/accounts/password_reset_confirm.html Wed Jul 20 20:54:36 2016 -0500 @@ -1,23 +1,44 @@ -{% extends 'base.html' %} +{% extends 'v3/base.html' %} {% block title %}Reset Password{% endblock %} {% block content %}

Reset Password

{% if validlink %} -

-Please use the following form to reset your password. -

-
{% csrf_token %} - -{{ form.as_table }} - -
  -
-
+

+ Please use the following form to reset your password. +

+
{% csrf_token %} + {{ form.non_field_errors }} + {{ form.new_password1.errors }} +
+
+ +
+
+ {{ form.new_password2.errors }} +
+
+ +
+
+ +
{% else %} -

-We're sorry, the link you provided is invalid or has expired. If you are trying to -reset your password, please try again. -If you have questions or problems, please contact us. -

+
+

+ We're sorry, this reset password link is either invalid or has expired. + If you are trying to reset your password, please + try again. +

+

+ If you have questions or continue to have problems, please + contact us. +

+
{% endif %} {% endblock %} diff -r 85119508e072 -r dd57bacde961 sg101/templates/accounts/password_reset_sent.html --- a/sg101/templates/accounts/password_reset_sent.html Tue Jul 19 21:20:44 2016 -0500 +++ b/sg101/templates/accounts/password_reset_sent.html Wed Jul 20 20:54:36 2016 -0500 @@ -1,10 +1,15 @@ -{% extends 'base.html' %} +{% extends 'v3/base.html' %} {% block title %}Password Reset Instructions Sent{% endblock %} {% block content %}

Password Reset Instructions Sent

-

-Instructions on how to reset your password have been sent to your email address. Please visit the -link provided in the email to reset your password. -

-

If you do not receive the email within a few minutes, please check any spam folders.

+
+

+ Instructions on how to reset your password have been sent to your email address. + Please visit the link provided in the email to reset your password. +

+

+ If you do not receive the email within a few minutes, please check any spam + folders. +

+
{% endblock %}