{% extends 'admin/base_site.html' %}
{% load i18n static simpelcore_tags %}

{% block extrahead %}
  {{ block.super }}
  <script src="{% url 'admin:jsi18n' %}"></script>
  <script src="{% static 'admin/js/core.js' %}"></script>
  <link rel="stylesheet" href="{% static 'admin/css/widgets.css' %}">
  {{ form.media }}
{% endblock %}

{% block content %}
<div class="card card-body p-6">
  <form action="" method="post">
    {% csrf_token %}
    {% if form.non_field_errors %}<div class="errornote">{{ form.non_field_errors }}</div>{% endif %}
    <fieldset class="module aligned">
      {% for field in form.hidden_fields %}
          {{ field }}
        {% endfor %}
        {% for field in form.visible_fields %}
          <div class="form-row">
            <label for="{{ field.name }}">{{ field.label }}</label>
            {{ field }}
            {% if field.help_text %}<div class="help">{{ field.help_text }}</div>{% endif %}
            {% if field.errors %}<div class="errors">{{ field.errors }}</div>{% endif %}
          </div>
        {% endfor %}
    </fieldset>
    <div class="submit-row">
      <input type="submit" value="Save" class="default" name="_save">
      <a class="btn btn-secondary"  href="{{ cancel_url }}"> <i class="mdi mdi-arrow-left"></i> {% trans "Cancel, take me back" %}</a>
    </div>
  </form>
</div>
{% endblock %}
