{% extends "admin/models/base.html" %}

{% block content %}
  {% if form.errors %}
    <div class="alert-message block-message error">
      <a class="close" href="#">×</a>
      <p>There were errors with your form submission</p>
    </div>
  {% endif %}
  <form method="post" action="." class="edit">
    <fieldset>
      <legend>Edit {{ model_admin.get_display_name() }}</legend>
      {% for field in form %}
        {{ admin_field(field) }}
      {% endfor %}
      <div class="actions">
        <button class="btn primary" type="submit">Save</button>
        <a class="btn" href="{{ url_for(model_admin.get_url_name('index')) }}">Cancel</a>
        <a class="btn danger pull-right" href="{{ url_for(model_admin.get_url_name('delete'), id=instance.get_pk()) }}">Delete</a>
      </div>
    </fieldset>
  </form>
{% endblock %}
