From 7477adec059fe49b34a6aae42ff9b43c1d2dd974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Mon, 4 Jan 2016 22:00:01 +0100 Subject: [PATCH] Authentication: custom templates for password change --- umap/templates/umap/password_change.html | 20 +++++++++++++++++++ umap/templates/umap/password_change_done.html | 9 +++++++++ umap/urls.py | 4 ++-- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 umap/templates/umap/password_change.html create mode 100644 umap/templates/umap/password_change_done.html diff --git a/umap/templates/umap/password_change.html b/umap/templates/umap/password_change.html new file mode 100644 index 00000000..0f030247 --- /dev/null +++ b/umap/templates/umap/password_change.html @@ -0,0 +1,20 @@ +{% extends "umap/content.html" %} + +{% load leaflet_storage_tags i18n %} + +{% block content %} +

{% trans "Password change" %}

+

{% trans "Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly." %}

+ +
+ {% csrf_token %} + {{ form.old_password.errors }} + + {{ form.new_password1.errors }} + + {{ form.new_password2.errors }} + + + +
+{% endblock content %} diff --git a/umap/templates/umap/password_change_done.html b/umap/templates/umap/password_change_done.html new file mode 100644 index 00000000..039e6121 --- /dev/null +++ b/umap/templates/umap/password_change_done.html @@ -0,0 +1,9 @@ +{% extends "umap/content.html" %} + +{% load leaflet_storage_tags i18n %} + +{% block content %} +

{% trans "Password change successful" %}

+

{% trans "Your password was changed." %}

+

Home

+{% endblock content %} diff --git a/umap/urls.py b/umap/urls.py index 8915568e..78ee6bd6 100644 --- a/umap/urls.py +++ b/umap/urls.py @@ -19,8 +19,8 @@ urlpatterns = patterns( url('', include('social.apps.django_app.urls', namespace='social')), url(r'^m/(?P\d+)/$', MapShortUrl.as_view(), name='umap_short_url'), url(r'^ajax-proxy/$', cache_page(180)(views.ajax_proxy), name='ajax-proxy'), # noqa - url(r'^change-password/', auth_views.password_change, name='password_change'), - url(r'^change-password-done/', auth_views.password_change_done, name='password_change_done'), + url(r'^change-password/', auth_views.password_change, { 'template_name': 'umap/password_change.html' }, name='password_change'), + url(r'^change-password-done/', auth_views.password_change_done, { 'template_name': 'umap/password_change_done.html' }, name='password_change_done'), ) urlpatterns += i18n_patterns( '',