{% extends "admin/base_site.html" %}
{% load admin_static admin_list i18n %}
{% load url from future %}


{% block extrastyle %}
  {{ block.super }}
  <link rel="stylesheet" type="text/css" href="{% static 'admin/css/changelists.css' %}" />
  <link rel="stylesheet" type="text/css" href="{% static 'admin/css/forms.css' %}" />
  {{ media.css }}
  <style>
    #result_list .changed {
          background-color: #ffc;
    }
    #changelist table thead th .text {
      padding: 2px 5px;
    }
    #changelist table tbody td:first-child {
        text-align: left;
    }
    #changelist-form ul.errorlist {
      margin: 0 !important;
    }
    .help {
        font-weight: normal !important;
  }
  </style>
{% endblock %}

{% block extrahead %}
{% url 'admin:jsi18n' as jsi18nurl %}
<script type="text/javascript" src="{{ jsi18nurl|default:'../../jsi18n/' }}"></script>
{{ block.super }}
{{ media.js }}
{% endblock %}

{% block bodyclass %}change-list{% endblock %}

{% block content %}
  <div id="content-main">
    <div class="module" id="changelist">
        <form id="changelist-form" action="" method="post">{% csrf_token %}
            {% if form.errors %}
            <ul class="errorlist">
            {% endif %}
            {% for field in form.hidden_fields %}
                {% for error in field.errors %}
                  <li>{{ error }}</li>
                {% endfor %}
                {{ field }}
            {% endfor %}
            {% if form.errors %}
            </ul>
            {% endif %}
            <table cellspacing="0" id="result_list">
                <thead>
                <tr>
                    <th><div class="text">{% trans "Name" %}</div></th>
                    <th><div class="text">{% trans "Default" %}</div></th>
                    <th><div class="text">{% trans "Value" %}</div></th>
                    <th><div class="text">{% trans "Is modified" %}</div></th>
                </tr>
                </thead>
                {% for item in config %}
                <tr class="{% cycle 'row1' 'row2' %}">
                    <th>{{ item.name }}
                        <div class="help">{{ item.help_text }}</div>
                    </th>
                    <td>
                        {{ item.default }}
                    </td>
                        <td>
                            {{ item.form_field.errors }}
                            {{ item.form_field }}
                        </td>
                    <td>
                        {% if item.modified %}
                            <img src="{% static 'admin/img/icon-yes.gif' %}" alt="{{ item.modified }}" />
                        {% else %}
                            <img src="{% static 'admin/img/icon-no.gif' %}" alt="{{ item.modified }}" />
                        {% endif %}
                    </td>
                    </tr>
                {% endfor %}
            </table>
            <p class="paginator">
            <input type="submit" name="_save" class="default" value="{% trans 'Save' %}"/>
            </p>
        </form>
    </div>
  </div>
{% endblock %}

{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ app_label|capfirst|escape }}</a>
&rsaquo; {{ opts.verbose_name_plural|capfirst }}
</div>
{% endblock %}
