Use the form helpers templatetags instead of hard coding forms.
authorMadhusudan.C.S <madhusudancs@gmail.com>
Mon, 31 Jan 2011 00:56:24 +0530
changeset 532 1f08247a935c
parent 531 13eba81f3aa1
child 533 773dc9a66748
Use the form helpers templatetags instead of hard coding forms.
pytask/templates/registration/password_change_form.html
pytask/templates/registration/password_reset_confirm.html
pytask/templates/registration/password_reset_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 %}
--- 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> &rsaquo; {% 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>
--- 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> &rsaquo; {% 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 %}