From 5f64af9ecb91b3a261b9094a8e6f8894c32abe61 Mon Sep 17 00:00:00 2001 From: Julien Phalip Date: Sun, 6 Nov 2011 01:19:40 +0000 Subject: [PATCH] Fixed #17152 -- Fixed a few anomalies in the `contrib.formtools` documentation and templates. Thanks, Bradley Ayers. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17072 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- .../formtools/wizard/wizard_form.html | 5 +++-- docs/ref/contrib/formtools/form-wizard.txt | 21 ++++++++++++------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/django/contrib/formtools/templates/formtools/wizard/wizard_form.html b/django/contrib/formtools/templates/formtools/wizard/wizard_form.html index b98e58d1c7..fe755222ed 100644 --- a/django/contrib/formtools/templates/formtools/wizard/wizard_form.html +++ b/django/contrib/formtools/templates/formtools/wizard/wizard_form.html @@ -1,5 +1,6 @@ {% load i18n %} {% csrf_token %} +{{ wizard.form.media }} {{ wizard.management_form }} {% if wizard.form.forms %} {{ wizard.form.management_form }} @@ -11,7 +12,7 @@ {% endif %} {% if wizard.steps.prev %} - - + + {% endif %} diff --git a/docs/ref/contrib/formtools/form-wizard.txt b/docs/ref/contrib/formtools/form-wizard.txt index ba2f4e8ae5..aadd7d276f 100644 --- a/docs/ref/contrib/formtools/form-wizard.txt +++ b/docs/ref/contrib/formtools/form-wizard.txt @@ -160,8 +160,9 @@ latter one allows you to use a different template for each form. This template expects a ``wizard`` object that has various items attached to it: -* ``form`` -- The :class:`~django.forms.Form` instance for the current - step (either empty or with errors). +* ``form`` -- The :class:`~django.forms.Form` or + :class:`~django.forms.formset.BaseFormSet` instance for the current step + (either empty or with errors). * ``steps`` -- A helper object to access the various steps related data: @@ -186,9 +187,13 @@ Here's a full example template: {% extends "base.html" %} + {% block head %} + {{ wizard.form.media }} + {% endblock %} + {% block content %}

Step {{ wizard.steps.step1 }} of {{ wizard.steps.count }}

-
{% csrf_token %} + {% csrf_token %} {{ wizard.management_form }} {% if wizard.form.forms %} @@ -199,12 +204,12 @@ Here's a full example template: {% else %} {{ wizard.form }} {% endif %} - {% if wizard.steps.prev %} - - - {% endif %}
- + {% if wizard.steps.prev %} + + + {% endif %} +
{% endblock %}