Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #17152 -- Fixed a few anomalies in the `contrib.formtools` docu…

…mentation and templates. Thanks, Bradley Ayers.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17072 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 5f64af9ecb91b3a261b9094a8e6f8894c32abe61 1 parent b2948d8
Julien Phalip authored November 06, 2011
5  django/contrib/formtools/templates/formtools/wizard/wizard_form.html
... ...
@@ -1,5 +1,6 @@
1 1
 {% load i18n %}
2 2
 {% csrf_token %}
  3
+{{ wizard.form.media }}
3 4
 {{ wizard.management_form }}
4 5
 {% if wizard.form.forms %}
5 6
     {{ wizard.form.management_form }}
@@ -11,7 +12,7 @@
11 12
 {% endif %}
12 13
 
13 14
 {% if wizard.steps.prev %}
14  
-<button name="wizard_prev_step" value="{{ wizard.steps.first }}">{% trans "first step" %}</button>
15  
-<button name="wizard_prev_step" value="{{ wizard.steps.prev }}">{% trans "prev step" %}</button>
  15
+<button name="wizard_prev_step" type="submit" value="{{ wizard.steps.first }}">{% trans "first step" %}</button>
  16
+<button name="wizard_prev_step" type="submit" value="{{ wizard.steps.prev }}">{% trans "prev step" %}</button>
16 17
 {% endif %}
17 18
 <input type="submit" name="submit" value="{% trans "submit" %}" />
19  docs/ref/contrib/formtools/form-wizard.txt
@@ -160,8 +160,9 @@ latter one allows you to use a different template for each form.
160 160
 This template expects a ``wizard`` object that has various items attached to
161 161
 it:
162 162
 
163  
-* ``form`` -- The :class:`~django.forms.Form` instance for the current
164  
-  step (either empty or with errors).
  163
+* ``form`` -- The :class:`~django.forms.Form` or
  164
+  :class:`~django.forms.formset.BaseFormSet` instance for the current step
  165
+  (either empty or with errors).
165 166
 
166 167
 * ``steps`` -- A helper object to access the various steps related data:
167 168
 
@@ -186,9 +187,13 @@ Here's a full example template:
186 187
 
187 188
     {% extends "base.html" %}
188 189
 
  190
+    {% block head %}
  191
+    {{ wizard.form.media }}
  192
+    {% endblock %}
  193
+
189 194
     {% block content %}
190 195
     <p>Step {{ wizard.steps.step1 }} of {{ wizard.steps.count }}</p>
191  
-    <form action="." method="post">{% csrf_token %}
  196
+    <form action="" method="post">{% csrf_token %}
192 197
     <table>
193 198
     {{ wizard.management_form }}
194 199
     {% if wizard.form.forms %}
@@ -199,12 +204,12 @@ Here's a full example template:
199 204
     {% else %}
200 205
         {{ wizard.form }}
201 206
     {% endif %}
  207
+    </table>
202 208
     {% if wizard.steps.prev %}
203  
-    <button name="wizard_prev_step" value="{{ wizard.steps.first }}">{% trans "first step" %}</button>
204  
-    <button name="wizard_prev_step" value="{{ wizard.steps.prev }}">{% trans "prev step" %}</button>
  209
+    <button name="wizard_prev_step" type="submit" value="{{ wizard.steps.first }}">{% trans "first step" %}</button>
  210
+    <button name="wizard_prev_step" type="submit" value="{{ wizard.steps.prev }}">{% trans "prev step" %}</button>
205 211
     {% endif %}
206  
-    </table>
207  
-    <input type="submit">
  212
+    <input type="submit" value="{% trans "submit" %}"/>
208 213
     </form>
209 214
     {% endblock %}
210 215
 

0 notes on commit 5f64af9

Please sign in to comment.
Something went wrong with that request. Please try again.