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

{% block bodyclass %}{{ block.super }} app-{{ app_label }}{% endblock %}

{% if not is_popup %}
{% block breadcrumbs %}
<ul class="app-breadcrumb breadcrumb">
<li class="breadcrumb-item"><a href="{% url 'admin:index' %}"><i class="fa fa-home fa-lg"></i>{% trans 'Home' %}</a></li>
<li class="breadcrumb-item">
{% for app in app_list %}
    {% ifequal app.app_label "auth" %}
        {% trans 'Authentication' %}
    {% else %}
        {{ app.name }}
    {% endifequal %}
{% endfor %}
</li>
</ul>
{% endblock %}
{% endif %}
{% block content %}
<div id="content-main" class="col">

{% if app_list %}
    {% for app in app_list %}
        <div class="app-{{ app.app_label }} module tile">
            <div class="tile-title line-head">
                <h5>
            {% ifequal app.app_label "auth" %}
                <a href="{{ app.app_url }}" class="section" title="{% blocktrans with name=app.name %}Models in the {{ name }} application{% endblocktrans %}">{% trans 'Authentication' %}</a>
            {% else %}
                <a href="{{ app.app_url }}" class="section" title="{% blocktrans with name=app.name %}Models in the {{ name }} application{% endblocktrans %}">{{ app.name }}</a>
            {% endifequal %}
        </h5>
            </div>
        <table  class="table table-hover table-bordered table-striped">

        {% 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="btn btn-sm btn-outline-primary">{% trans 'Add' %}</a></td>
            {% else %}
                <td>&nbsp;</td>
            {% endif %}

            {% if model.admin_url %}
                <td><a href="{{ model.admin_url }}" class="btn btn-sm btn-outline-success">{% trans 'Change' %}</a></td>
            {% else %}
                <td>&nbsp;</td>
            {% endif %}
            </tr>
        {% endfor %}
        </table>
        </div>
    {% endfor %}
{% else %}
    <p>{% trans "You don't have permission to edit anything." %}</p>
{% endif %}
</div>
{% endblock %}
{% block sidebar %}{% endblock %}
