form_host.html 1.3 KB
Newer Older
Bryan  BRANCOTTE's avatar
Bryan BRANCOTTE committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{% extends basetheme_bootstrap_base_template %}
{% load crispy_forms_tags %}
{% load static %}
{% load i18n %}

{% 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'}}">
36
            <button class="{{btn_classes|default:'btn btn-primary'}}" type="submit">{{ submit_text|default:"OK" }}</button>
Bryan  BRANCOTTE's avatar
Bryan BRANCOTTE committed
37
38
39
40
        </div>
    </form>
</div>
{% endblock %}