wizard_formset_with_nested_formset.html 1.23 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{% extends "add.html" %}
{% load i18n %}
{% load customtags %}
{% load sstatic %}

{% block extra_js %}
{{block.super}}
<script src="{% sstatic '/js/wizard_formset_with_nested_formset.js'%}"></script>
{% endblock extra_js %}


{% block form %}
<div class="form_div form_div-fluid">
    {{ wizard.management_form }}
    {{ wizard.non_form_errors }}

    {{ wizard.form.management_form }}
18
    {{ wizard.form.non_field_errors|bootstrap}}
19
20

    {% for form in wizard.form.forms %}
21
        {% include "form_with_nested_formset.html" with form=form nested_forms=form.nested.forms nested_form=None add_another_nested_one="+ Add result" parent_prefix=wizard.form.prefix %}
22
23
24
    {% endfor %}
    <div class="form_div">
        <input type="button"
25
26
               class="add-test"
               value="{%block add_another_one %}+ Add test{%endblock%}"
27
               onclick="add_form_to_nested_formset(this,'{{wizard.form.prefix}}');"/>
28
29
30
31
32
    </div>
</div>
{% endblock %}

{% block emptyform %}
33
{% include "form_with_nested_formset.html" with form=wizard.form.empty_form nested_forms=wizard.form.empty_form.nested.forms nested_form=wizard.form.empty_form.nested.empty_form add_another_nested_one="+ Add result" parent_prefix=wizard.form.prefix %}
34
{% endblock emptyform%}