Code

Ticket #17152: 17152.diff

File 17152.diff, 2.8 KB (added by Bradley Ayers <bradley.ayers@…>, 3 years ago)
Line 
1Index: docs/ref/contrib/formtools/form-wizard.txt
2===================================================================
3--- docs/ref/contrib/formtools/form-wizard.txt  (revision 17068)
4+++ docs/ref/contrib/formtools/form-wizard.txt  (working copy)
5@@ -160,8 +160,9 @@
6 This template expects a ``wizard`` object that has various items attached to
7 it:
8 
9-* ``form`` -- The :class:`~django.forms.Form` instance for the current
10-  step (either empty or with errors).
11+* ``form`` -- The :class:`~django.forms.Form` or
12+  :class:`~django.forms.formset.BaseFormSet` instance for the current step
13+  (either empty or with errors).
14 
15 * ``steps`` -- A helper object to access the various steps related data:
16 
17@@ -186,9 +187,13 @@
18 
19     {% extends "base.html" %}
20 
21+    {% block head %}
22+    {{ wizard.form.media }}
23+    {% endblock %}
24+
25     {% block content %}
26     <p>Step {{ wizard.steps.step1 }} of {{ wizard.steps.count }}</p>
27-    <form action="." method="post">{% csrf_token %}
28+    <form action="" method="post">{% csrf_token %}
29     <table>
30     {{ wizard.management_form }}
31     {% if wizard.form.forms %}
32@@ -199,12 +204,12 @@
33     {% else %}
34         {{ wizard.form }}
35     {% endif %}
36+    </table>
37     {% if wizard.steps.prev %}
38-    <button name="wizard_prev_step" value="{{ wizard.steps.first }}">{% trans "first step" %}</button>
39-    <button name="wizard_prev_step" value="{{ wizard.steps.prev }}">{% trans "prev step" %}</button>
40+    <button name="wizard_prev_step" type="submit" value="{{ wizard.steps.first }}">{% trans "first step" %}</button>
41+    <button name="wizard_prev_step" type="submit" value="{{ wizard.steps.prev }}">{% trans "prev step" %}</button>
42     {% endif %}
43-    </table>
44-    <input type="submit">
45+    <input type="submit" value="{% trans "submit" %}"/>
46     </form>
47     {% endblock %}
48 
49Index: django/contrib/formtools/templates/formtools/wizard/wizard_form.html
50===================================================================
51--- django/contrib/formtools/templates/formtools/wizard/wizard_form.html        (revision 17068)
52+++ django/contrib/formtools/templates/formtools/wizard/wizard_form.html        (working copy)
53@@ -1,3 +1,5 @@
54+{{ wizard.form.media }}
55+
56 {% load i18n %}
57 {% csrf_token %}
58 {{ wizard.management_form }}
59@@ -11,7 +13,7 @@
60 {% endif %}
61 
62 {% if wizard.steps.prev %}
63-<button name="wizard_prev_step" value="{{ wizard.steps.first }}">{% trans "first step" %}</button>
64-<button name="wizard_prev_step" value="{{ wizard.steps.prev }}">{% trans "prev step" %}</button>
65+<button name="wizard_prev_step" type="submit" value="{{ wizard.steps.first }}">{% trans "first step" %}</button>
66+<button name="wizard_prev_step" type="submit" value="{{ wizard.steps.prev }}">{% trans "prev step" %}</button>
67 {% endif %}
68 <input type="submit" name="submit" value="{% trans "submit" %}" />