wizard in bootstrap, via crispy

This commit is contained in:
Thomas NOËL 2012-05-10 17:41:13 +02:00
parent dea97f7194
commit a48de02f57
3 changed files with 17 additions and 8 deletions

View File

@ -1,5 +1,7 @@
{% extends "base.html" %}
{% load crispy_forms_tags %}
{% block extra_scripts %}
{{ block.super }}
{{ form.media }}
@ -8,9 +10,9 @@
{% block body %}
<p>Étape {{ wizard.steps.step1 }} sur {{ wizard.steps.count }}</p>
<h2>Étape {{ wizard.steps.step1 }} sur {{ wizard.steps.count }}</h2>
<form action="" method="post" enctype="multipart/form-data">
<form action="" method="post" enctype="multipart/form-data" class="bootstrap">
{% csrf_token %}
@ -19,16 +21,18 @@
{% if wizard.form.forms %}
{{ wizard.form.management_form }}
{% for form in wizard.form.forms %}
{{ form.as_ul }}
{{ form|crispy }}
{% endfor %}
{% else %}
{{ wizard.form.as_ul }}
{{ wizard.form|crispy }}
{% endif %}
{% if wizard.steps.prev %}
<button name="wizard_goto_step" type="submit" value="{{ wizard.steps.prev }}">Retour</button>
{% endif %}
<input type="submit" value="Suite" />
<div>
<button name="submit" type="submit" class="btn pull-right"/>Suite <i class="icon-forward"></i></button>
{% if wizard.steps.prev %}
<button name="wizard_goto_step" type="submit" value="{{ wizard.steps.prev }}" class="btn pull-left"><i class="icon-backward"></i> Retour</button>
{% endif %}
</div>
</form>

View File

@ -121,11 +121,15 @@ INSTALLED_APPS = (
'django.contrib.admin',
# 'django.contrib.admindocs',
'mptt',
'crispy_forms',
'polynum.base',
'polynum.request',
'django.contrib.formtools',
)
# From http://django-crispy-forms.readthedocs.org/en/d-0/install.html
CRISPY_TEMPLATE_PACK = 'bootstrap'
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.

View File

@ -20,5 +20,6 @@ setup(name="Polynum",
'django >= 1.4',
'django-mptt >= 0.5',
'south >= 0.7',
'django-crispy-forms',
],
)