# HG changeset patch # User Madhusudan.C.S <madhusudancs@gmail.com> # Date 1296415584 -19800 # Node ID 1f08247a935c2a5fa5f8225738f743f0634cc280 # Parent 13eba81f3aa1758cdc52e7b74f9946d128532c6b Use the form helpers templatetags instead of hard coding forms. diff -r 13eba81f3aa1 -r 1f08247a935c pytask/templates/registration/password_change_form.html --- a/pytask/templates/registration/password_change_form.html Mon Jan 31 00:55:41 2011 +0530 +++ b/pytask/templates/registration/password_change_form.html Mon Jan 31 00:56:24 2011 +0530 @@ -1,23 +1,15 @@ {% extends "base.html" %} +{% load i18n %} +{% load form_helpers %} + {% block title %}{% trans 'Password change' %}{% endblock %} {% block content %} -<h1>{% trans 'Password change' %}</h1> +<h1>{% trans 'Password Change' %}</h1> <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="" method="post"> -{% csrf_token %} -{{ form.old_password.errors }} -<p class="aligned wide"><label for="id_old_password">{% trans 'Old password:' %}</label>{{ form.old_password }}</p> -{{ form.new_password1.errors }} -<p class="aligned wide"><label for="id_new_password1">{% trans 'New password:' %}</label>{{ form.new_password1 }}</p> -{{ form.new_password2.errors }} -<p class="aligned wide"><label for="id_new_password2">{% trans 'Confirm password:' %}</label>{{ form.new_password2 }}</p> - -<p><input type="submit" value="{% trans 'Change my password' %}" /></p> -</form> - +{% as_div_form form "Password Change Form" csrf_token "Change password" %} {% endblock %} diff -r 13eba81f3aa1 -r 1f08247a935c pytask/templates/registration/password_reset_confirm.html --- a/pytask/templates/registration/password_reset_confirm.html Mon Jan 31 00:55:41 2011 +0530 +++ b/pytask/templates/registration/password_reset_confirm.html Mon Jan 31 00:56:24 2011 +0530 @@ -1,5 +1,8 @@ {% extends "base.html" %} + + {% load i18n %} +{% load form_helpers %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">{% trans 'Home' %}</a> › {% trans 'Password reset confirmation' %}</div>{% endblock %} @@ -13,15 +16,7 @@ <p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p> -<form action="" method="post"> -{% csrf_token %} -{{ form.new_password1.errors }} -<p class="aligned wide"><label for="id_new_password1">{% trans 'New password:' %}</label>{{ form.new_password1 }}</p> -{{ form.new_password2.errors }} -<p class="aligned wide"><label for="id_new_password2">{% trans 'Confirm password:' %}</label>{{ form.new_password2 }}</p> -<p><input type="submit" value="{% trans 'Change my password' %}" /></p> -</form> - +{% as_div_form form "Password Change Form" csrf_token "Change password" %} {% else %} <h1>{% trans 'Password reset unsuccessful' %}</h1> diff -r 13eba81f3aa1 -r 1f08247a935c pytask/templates/registration/password_reset_form.html --- a/pytask/templates/registration/password_reset_form.html Mon Jan 31 00:55:41 2011 +0530 +++ b/pytask/templates/registration/password_reset_form.html Mon Jan 31 00:56:24 2011 +0530 @@ -1,5 +1,8 @@ {% extends "base.html" %} + + {% load i18n %} +{% load form_helpers %} {% block breadcrumbs %}<div class="breadcrumbs"><a href="../">{% trans 'Home' %}</a> › {% trans 'Password reset' %}</div>{% endblock %} @@ -11,10 +14,6 @@ <p>{% trans "Forgotten your password? Enter your e-mail address below, and we'll e-mail instructions for setting a new one." %}</p> -<form action="" method="post"> -{% csrf_token %} -{{ form.email.errors }} -<p><label for="id_email">{% trans 'E-mail address:' %}</label> {{ form.email }} <input type="submit" value="{% trans 'Reset my password' %}" /></p> -</form> +{% as_div_form form "Password Reset Email" csrf_token "Email instructions" %} {% endblock %}