wizard in bootstrap, via crispy
This commit is contained in:
parent
dea97f7194
commit
a48de02f57
|
@ -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>
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
Reference in New Issue