{% load freeadmin %}
<form data-dojo-type="dijit.form.Form" id="form_{% cls_name form %}" {% if form and form.is_multipart %}enctype="multipart/form-data" {% endif %}method="POST">
    <script type="dojo/method" data-dojo-event="submitForm" data-dojo-args="form,e,conf">
        {% block onSubmit %}
        doSubmit({
	    form: this,
	    event: e,
	    url: '{% block formpost %}{{ request.path }}{% endblock %}',
            confirm: conf
	    });
        {% endblock %}
    </script>
    <script type="dojo/event" data-dojo-event="onSubmit" data-dojo-args="e">
    this.submitForm(this, e);
    </script>
<table class="form">
    {% block form %}
    {% csrf_token %}
    {% admin_form form %}
    {% endblock %}
</table>
    {% block buttons %}
    <button id="btn_{% cls_name form %}_Ok" data-dojo-type="dijit.form.Button" type="submit" data-dojo-props="type:'submit'" class="submitform">
        {% block oklabel %}{% trans "OK" %}{% endblock %}
    </button>
    {% if not inline %}
    <button id="btn_{% cls_name form %}_Cancel" data-dojo-type="dijit.form.Button" type="button">
        {% block cancellabel %}{% trans "Cancel" %}{% endblock %}
        <script type="dojo/method" data-dojo-event="onClick" data-dojo-args="evt">
            cancelDialog(this);
        </script>
    </button>
    {% endif %}
    {% with form.advanced_fields as advfields %}
    {% include "freeadmin/advanced_btn.html" %}
    {% endwith %}
    {% block extra_buttons %}{% endblock %}
    {% endblock %}
</form>
