{% load freeadmin %}
<form data-dojo-type="dijit.form.Form" id="dialogForm_{{ model_name }}"{% if form and form.is_multipart %} enctype="multipart/form-data"{% endif %}>
<script type="dojo/method" data-dojo-event="submitForm" data-dojo-args="form,e,conf">
     doSubmit({
        form: form,
        event: e,
        url: '{{ request.path }}',
        confirm: conf
     });
</script>
{% block post_form %}
<script type="dojo/event" data-dojo-event="onSubmit" data-dojo-args="e">
this.submitForm(this, e);
</script>
{% endblock %}
<table class="form">
    {% csrf_token %}
    {% block formset_top %}
    {% include "freeadmin/generic_model_inline.html" with position='top' %}
    {% endblock %}
    {% block form %}
    {% admin_form form %}
    {% endblock %}
    {% block formset_bottom %}
    {% include "freeadmin/generic_model_inline.html" with position='bottom' %}
    {% endblock %}
    {% block buttons %}
    <tr><td colspan="2">
        <button id="btn_{{ model_name }}_Add" class="submitform" data-dojo-type="dijit.form.Button" data-dojo-props="type: 'submit'">
            {% if extra_js %}
            <script type="dojo/method">
                {{ extra_js }}
            </script>
            {% endif %}
            {% trans "OK" %}
        </button>
        <button id="btn_{{ model_name }}_Cancel" data-dojo-type="dijit.form.Button" class="cancelform">
            {% trans "Cancel" %}
            <script type="dojo/method" data-dojo-event="onClick" data-dojo-args="evt">
                cancelDialog(this);
            </script>
        </button>
        {% with form.advanced_fields as advfields %}
        {% include "freeadmin/advanced_btn.html" %}
        {% endwith %}
        {% block buttons_extra %}
        {% endblock %}
    </td></tr>
    {% endblock %}
</table>
</form>
