form_host.html 1.43 KB
Newer Older
Bryan  BRANCOTTE's avatar
Bryan BRANCOTTE committed
1
2
3
4
5
{% extends basetheme_bootstrap_base_template %}
{% load crispy_forms_tags %}
{% load static %}
{% load i18n %}

Bryan  BRANCOTTE's avatar
Bryan BRANCOTTE committed
6
7
8
9
10
11
12
{% block extra_js %}
{{block.super}}
{% if extra_js_file %}
<script src="{% static extra_js_file %}"></script>
{% endif%}
{% endblock %}

Bryan  BRANCOTTE's avatar
Bryan BRANCOTTE committed
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{% block title %}{{ title }}{% endblock %}
{% block page_title %}{{ page_title|default:title }}{% endblock %}

{% block content %}
<div class="col-12 col-xs-12">
    {%if form_title%}<h2>{{form_title}}</h2>{%endif%}
    <form method="post" enctype="multipart/form-data">
        {% csrf_token %}
        {%if form%}
        {%if form.forms%}
				{{ form.management_form }}
        <div class="row col-12">
            {% for f in form.forms %}
            <div class="{{ formset_css_classes|default:'mb-4'}}">
                <div class="card">
                    <div class="card-body">
                        {{ f|crispy }}
                    </div>
                </div>
            </div>
            {%endfor%}
        </div>
        {%else%}
        {{ form|crispy }}
        {%endif%}
        {%endif%}
        {%if cancel_url%}
        <a role="button" class="btn btn-primary" href="{{cancel_url}}">{{ cancel_text|default:"Cancel"}}</a>
        {%endif%}
        <div class="form-class {{btn_container_classes|default:'pull-right'}}">
43
            <button class="{{btn_classes|default:'btn btn-primary'}}" type="submit">{{ submit_text|default:"OK" }}</button>
Bryan  BRANCOTTE's avatar
Bryan BRANCOTTE committed
44
45
46
47
        </div>
    </form>
</div>
{% endblock %}