{% load freeadmin %}
  <form data-dojo-type="dijit.form.Form" action="." enctype="multipart/form-data" method="post">{% csrf_token %}
    <script type="dojo/method" data-dojo-event="doSubmit" data-dojo-args="e">
      doSubmit({
        form: this,
        event: e,
        url: '{{ request.path }}'
      });
    </script>
    <script type="dojo/event" data-dojo-event="onSubmit" data-dojo-args="e">
      {% block onSubmit %}
      this.doSubmit(e);
      {% endblock %}
    </script>
  <table class="form">
    {% block form %}
    <tr>
      <td colspan="2">
      {% dojo_render wizard.management_form %}
      <div data-dojo-type="freeadmin/WizardShares" data-dojo-props="initial: '{{ form.data_to_store|escapejs }}'"></div>
      </td>
    </tr>
    {% endblock %}
    <tr class="formButtons">
      <td colspan="2">
        {% if wizard.steps.prev %}
        <button data-dojo-type="dijit.form.Button" type="button">
          {% trans "Previous" %}
          <script type="dojo/method" data-dojo-event="onClick" data-dojo-args="evt">
          var btn = this;
          require(["dijit/form/TextBox"], function(TextBox) {
            new TextBox({
              name: "wizard_goto_step",
              value: "{{ wizard.steps.prev|escapejs }}",
              type: "hidden"
            }).placeAt(btn.domNode.parentNode.parentNode);
            var form = getForm(btn);
            form.doSubmit(evt);
          });
          </script>
        </button>
        {% endif %}
        <button id="btn_{% cls_name wizard.form %}_Ok" class="submitform" data-dojo-type="dijit.form.Button" type="submit" data-dojo-props="type:'submit'">
          {% block oklabel %}{% trans "Next" %}{% endblock %}
          <script type="dojo/method" data-dojo-event="onClick" data-dojo-args="evt">
            this.set('label', '{% trans "Please wait..."|escapejs %}');
          </script>
        </button>

        <button id="btn_{% cls_name wizard.form %}_Cancel" class="submitform" data-dojo-type="dijit.form.Button">
          {% trans "Exit" %}
          <script type="dojo/method" data-dojo-event="onClick" data-dojo-args="evt">
            cancelDialog(this);
          </script>
        </button>
      </td>
    </tr>
  </table>
  </form>
