{% load i18n l10n bootstrap4 %}
{% comment %}
    A generic modal form template which is based on django-bootstrap-modal-forms package
    https://pypi.org/project/django-bootstrap-modal-forms/
{% endcomment %}


<form method="post" action="" {% for attr_key, attr_val in form.form_attrs.items %} {{attr_key}}="{{attr_val}}"{% endfor %}>
  {% csrf_token %}
    <div class="modal-header">
        <h5 class="modal-title">{{form.form_title}}</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
        </button>
    </div>

    <div class="modal-body">
        <article>
            {{ form.form_caption|linebreaks }}
        </article>
        {% include 'form/table/generic_table_form_body.html' %}
    </div>
    {% if form.render_submit %}
    <div class="modal-footer">
        <button type="submit" class="btn btn-default" title="{{form.action_btn_label}}">{{form.action_btn_label}}</button>
    </div>
    {% endif %}
</form>