Ticket #17152: 17152.diff

File 17152.diff, 2.8 KB (added by Bradley Ayers <bradley.ayers@…>, 4 years ago)
  • docs/ref/contrib/formtools/form-wizard.txt

     
    160160This template expects a ``wizard`` object that has various items attached to
    161161it:
    162162
    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).
    165166
    166167* ``steps`` -- A helper object to access the various steps related data:
    167168
     
    186187
    187188    {% extends "base.html" %}
    188189
     190    {% block head %}
     191    {{ wizard.form.media }}
     192    {% endblock %}
     193
    189194    {% block content %}
    190195    <p>Step {{ wizard.steps.step1 }} of {{ wizard.steps.count }}</p>
    191     <form action="." method="post">{% csrf_token %}
     196    <form action="" method="post">{% csrf_token %}
    192197    <table>
    193198    {{ wizard.management_form }}
    194199    {% if wizard.form.forms %}
     
    199204    {% else %}
    200205        {{ wizard.form }}
    201206    {% endif %}
     207    </table>
    202208    {% 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>
    205211    {% endif %}
    206     </table>
    207     <input type="submit">
     212    <input type="submit" value="{% trans "submit" %}"/>
    208213    </form>
    209214    {% endblock %}
    210215
  • django/contrib/formtools/templates/formtools/wizard/wizard_form.html

     
     1{{ wizard.form.media }}
     2
    13{% load i18n %}
    24{% csrf_token %}
    35{{ wizard.management_form }}
     
    1113{% endif %}
    1214
    1315{% 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>
     16<button name="wizard_prev_step" type="submit" value="{{ wizard.steps.first }}">{% trans "first step" %}</button>
     17<button name="wizard_prev_step" type="submit" value="{{ wizard.steps.prev }}">{% trans "prev step" %}</button>
    1618{% endif %}
    1719<input type="submit" name="submit" value="{% trans "submit" %}" />
Back to Top