{% extends "admin/index.html" %}
{% load i18n static django_admin_index %}

{% block extrastyle %}{{ block.super }}
<link rel="stylesheet" href="{% static "admin/css/admin-index.css" %}">{% endblock %}

{% block nav-global %}{% include "django_admin_index/includes/app_list.html" %}{% endblock nav-global %}

{% block content %}
<div id="content-main">

{% dashboard_app_list as dashboard_app_list %}
{% admin_index_settings as admin_index_settings %}

{% if dashboard_app_list %}
    {% for app in dashboard_app_list %}
        <div class="app-{{ app.app_label }} module">
        <table>
        <caption>
            {# NOTE: Remove app groups if needed #}
            {% if admin_index_settings.HIDE_APP_INDEX_PAGES %}
                {{ app.name }}
            {% else %}
                <a href="{{ app.app_url }}" class="section" title="{% blocktrans with name=app.name %}Models in the {{ name }} application{% endblocktrans %}">{{ app.name }}</a>
            {% endif %}
        </caption>
        {% for model in app.models %}
            <tr class="model-{{ model.object_name|lower }}">
            {% if model.admin_url %}
                <th scope="row"><a href="{{ model.admin_url }}">{{ model.name }}</a></th>
            {% else %}
                <th scope="row">{{ model.name }}</th>
            {% endif %}

            {% if model.add_url %}
                <td><a href="{{ model.add_url }}" class="addlink">{% trans 'Add' %}</a></td>
            {% else %}
                <td>&nbsp;</td>
            {% endif %}

            {% if model.admin_url %}
                {% if model.view_only %}
                <td><a href="{{ model.admin_url }}" class="viewlink">{% trans 'View' %}</a></td>
                {% else %}
                <td><a href="{{ model.admin_url }}" class="changelink">{% trans 'Change' %}</a></td>
                {% endif %}
            {% else %}
                <td>&nbsp;</td>
            {% endif %}
            </tr>
        {% endfor %}
        </table>
        </div>
    {% endfor %}
{% else %}
    <p>{% trans "You don't have permission to view or edit anything." %}</p>
{% endif %}
</div>
{% endblock %}
