Authentication: custom templates for password change

This commit is contained in:
Stephan Bösch-Plepelits 2016-01-04 22:00:01 +01:00
parent 2f2e0f510d
commit 7477adec05
3 changed files with 31 additions and 2 deletions

View file

@ -0,0 +1,20 @@
{% extends "umap/content.html" %}
{% load leaflet_storage_tags i18n %}
{% block content %}
<h2 class="section">{% trans "Password change" %}</h2>
<p>{% 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." %}</p>
<form action="{% url 'password_change' %}" method="POST">
{% csrf_token %}
{{ form.old_password.errors }}
<input type='password' name='old_password' placeholder='{% trans "Old password" %}' autofocus />
{{ form.new_password1.errors }}
<input type='password' name='new_password1' placeholder='{% trans "New password" %}' />
{{ form.new_password2.errors }}
<input type='password' name='new_password2' placeholder='{% trans "New password confirmation" %}' />
<input type='submit' value='{% trans "Change my password" %}' />
</form>
{% endblock content %}

View file

@ -0,0 +1,9 @@
{% extends "umap/content.html" %}
{% load leaflet_storage_tags i18n %}
{% block content %}
<h2 class="section">{% trans "Password change successful" %}</h2>
<p>{% trans "Your password was changed." %}</p>
<p><a href="{% url 'home' %}">Home</a></p>
{% endblock content %}

View file

@ -19,8 +19,8 @@ urlpatterns = patterns(
url('', include('social.apps.django_app.urls', namespace='social')),
url(r'^m/(?P<pk>\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(
'',