{% extends "horizon/common/_modal.html" %}
{% block content %}
  {% if table %}
    <div class="modal-body">
      {{ table.render }}
    </div>
  {% endif %}
  <form id="{% block form_id %}{{ form_id }}{% endblock %}"
        ng-controller="{% block ng_controller %}DummyController{% endblock %}"
        name="{% block form_name %}{% endblock %}"
        autocomplete="{% block autocomplete %}{% if form.no_autocomplete %}off{% endif %}{% endblock %}"
        class="{% block form_class %}{% endblock %}"
        action="{% block form_action %}{{ submit_url }}{% endblock %}"
        method="{% block form-method %}POST{% endblock %}"
      {% block form_validation %}{% endblock %}
        {% if add_to_field %}data-add-to-field="{{ add_to_field }}"{% endif %} {% block form_attrs %}{% endblock %}>{% csrf_token %}
    <div class="modal-body clearfix">
      {% comment %}
        These fake fields are required to prevent Chrome v34+ from autofilling form.
        {% endcomment %}
      {% if form.no_autocomplete %}
      <div class="fake_credentials" style="display: none">
        <input type="text" name="fake_email" value="" />
        <input type="password" name="fake_password" value="" />
      </div>
      {% endif %}
      {% block modal-body %}
        <div class="row">
          <div class="col-sm-6">
            <fieldset>
            {% include "horizon/common/_form_fields.html" %}
            </fieldset>
          </div>
          <div class="col-sm-6">
            {% block modal-body-right %}{% endblock %}
          </div>
        </div>
      {% endblock %}
    </div>
    <div class="modal-footer">
      {% block modal-footer %}
        {% if cancel_url %}
        <a href="{% block cancel_url %}{{ cancel_url }}{% endblock %}"
           class="btn btn-default cancel">
          {{ cancel_label }}
        </a>
        {% endif %}
        <input class="btn btn-primary" type="submit" value="{{ submit_label }}">
      {% endblock %}
    </div>
  </form>
{% endblock %}
