{% extends "sqladmin/layout.html" %}
{% from 'sqladmin/_macros.html' import render_form_fields %}
{% block content %}
<div class="col-12">
  <div class="card">
    <div class="card-header">
      <h3 class="card-title">New {{ model_view.name }}</h3>
    </div>
    <div class="card-body border-bottom py-3">
      <form action="{{ url_for('admin:create', identity=model_view.identity) }}" method="POST"
        enctype="multipart/form-data">
        <div class="row">
          {% if error %}
          <div class="alert alert-danger" role="alert">{{ error }}</div>
          {% endif %}
        </div>
        <fieldset class="form-fieldset">
          {{ render_form_fields(form, form_opts=form_opts) }}
        </fieldset>
        <div class="row">
          <div class="col-md-2">
            <a href="{{ url_for('admin:list', identity=model_view.identity) }}" class="btn">
              Cancel
            </a>
          </div>
          <div class="col-md-6">
            <div class="btn-group flex-wrap" data-toggle="buttons">
              <input type="submit" name="save" value="Save" class="btn">
              <input type="submit" name="save" value="Save and continue editing" class="btn">
              <input type="submit" name="save" value="Save and add another" class="btn">
            </div>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>
{% endblock %}