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

{% block extrastyle %}
  {{ block.super }}
  {% if cl.formset or action_form %}
    {% url 'admin:jsi18n' as jsi18nurl %}
    <script type="text/javascript" src="{{ jsi18nurl|default:'../../jsi18n/' }}"></script>
  {% endif %}
  {{ media.css }}
{% endblock %}

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

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

{% if not is_popup %}
{% block breadcrumbs %}
<ul class="breadcrumb">
	<li><a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> <span class="divider">/</span></li>
	<li><a href="{% url 'admin:app_list' app_label=cl.opts.app_label %}">{{ app_label|capfirst|escape }}</a> <span class="divider">/</span></li>
	<li class="active">{{ cl.opts.verbose_name_plural|capfirst }}</li>
</ul>
{% endblock %}
{% endif %}

{% block content %}
    {% block object-tools %}
      {% if has_add_permission %}
        <ul class="object-tools">
          {% block object-tools-items %}
            <li>
              <a href="{% url cl.opts|admin_urlname:'add' %}{% if is_popup %}?_popup=1{% endif %}" class="btn btn-success">
                <i class="icon-plus icon-white"></i> {% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}
              </a>
            </li>
          {% endblock %}
        </ul>
      {% endif %}
    {% endblock %}
    {% if cl.formset.errors %}
        <p class="errornote">
        {% blocktrans count cl.formset.errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
        </p>
        {{ cl.formset.non_form_errors }}
    {% endif %}
    <div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist">
      <form id="changelist-form" action="" method="post"{% if cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %}>{% csrf_token %}
      {% if cl.formset %}
        {{ cl.formset.management_form }}
      {% endif %}

      {% block result_list %}
          {% if action_form and actions_on_top and cl.full_result_count %}{% admin_actions %}{% endif %}
          {% result_list cl %}
          {% if action_form and actions_on_bottom and cl.full_result_count %}{% admin_actions %}{% endif %}
      {% endblock %}
      {% block pagination %}{% pagination cl %}{% endblock %}
      </form>
    </div>
{% endblock %}

{% block sidebar %}
	{% block search %}{% search_form cl %}{% endblock %}
    {% block date_hierarchy %}{% date_hierarchy cl %}{% endblock %}

    {% block filters %}
      {% if cl.has_filters %}
        <div id="changelist-filter" class="well">
          	<h2>{% trans 'Filter' %}</h2>
			<ul class="nav nav-list">
          		{% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %}
			</ul>
        </div>
      {% endif %}
    {% endblock %}
{% endblock sidebar %}

{% block extrascripts %}
{{ media.js }}
{% if action_form %}{% if actions_on_top or actions_on_bottom %}
<script type="text/javascript">
(function($) {
    $(document).ready(function($) {
        $("tr input.action-select").actions();
    });
})(django.jQuery);
</script>
{% endif %}{% endif %}

{% endblock extrascripts %}