{% extends 'admin/base_site.html' %}
{% load i18n admin_urls static admin_modify simpelcore_tags simpelsettings_tags sorl_thumbnail %}

{% block extrahead %}
{{ block.super }}
{{ media }}
{% endblock %}

{% block content %}
  {% get_settings %}
  <div class="row">
    <div class="col-lg-9 order-md-1 order-2">
      <div class="card card-body shadow-sm p-6">
        <div class="changelist-form-container">
          <form action="" method="post" enctype="multipart/form-data">
            {% csrf_token %}
            {% if form.non_field_errors %}<div class="errornote">{{ form.non_field_errors }}</div>{% endif %}
            <fieldset class="module aligned">
              {% for field in form %}
                  <div class="form-row">
                    <div{% if not line.fields|length_is:'1' %} class="fieldBox{% if field.name %} field-{{ field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if field.is_hidden %} hidden{% endif %}"{% elif field.is_checkbox %} class="checkbox-row"{% endif %}>
                      {% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %}
                      {% if field.is_checkbox %}
                          {{ field }}{{ field.label_tag }}
                      {% else %}
                          {{ field.label_tag }}
                          {% if field.is_readonly %}
                              <div class="readonly">{{ field.contents }}</div>
                          {% else %}
                              {{ field }}
                          {% endif %}
                      {% endif %}
                      {% if field.help_text %}
                          <div class="help">{{ field.help_text|safe }}</div>
                      {% endif %}
                    </div>
                  </div>
                {% endfor %}
            </fieldset>
            <div class="submit-row mb-0">
              <input type="submit" value="{% trans "Save" %}" class="default" name="_save">
            </div>
          </form>
        </div>
      </div>
    </div>
    <div class="col-lg-3 order-md-2 order-1 mb-4">
      {% get_settings_list as settings %}
      <div class="card bg-white">
        <div class="list-group list-group-flush">
          {% for setting in settings %}
          <a class="list-group-item px-4 py-3 {% if setting.opts.model_name == opts.model_name %}active{% endif %}" href="{{ setting.url }}">{{ setting.label }}</a> 
          {% endfor %}  
        </div>
      </div>
    </div>
  </div>
{% endblock %}
