{% extends "layout-modal.html" %}
{% load i18n auth_tags bootstrap %}

{% block header %}

<header>
  {% if form.labels.header %}
  {{ form.labels.header }}
  {% else %}
  <h2>{% trans "Edit" %} {{ view.ct_label|lower }}</h2>
  {% endif %}
</header>

{% endblock %}

{% block body %}

{% block errors %}
{% endblock %}

{% block form %}
<form action="{{ view.edit_url }}" method="POST"
      class="protected">

  {% csrf_token %}

  {% block formfields %}
  {{ form|bootstrap }}
  {% endblock %}

  {% block formcontrols %}
  <div class="btn-group form-actions">
    <button class="btn btn-primary" type="submit" 
            value="save" name="action">
      {% if form.labels.submit %}
      {{ form.labels.submit }}
      {% else %}
      {% trans "Save" %}
      {% endif %}
    </button>
    <button class="btn cancel">
      {% if form.labels.cancel %}
      {{ form.labels.cancel }}
      {% else %}
      {% trans "Cancel" %}
      {% endif %}
    </button>
  </div>
  {% endblock %}

</form>
{% endblock %}
{% endblock %}
