{% extends "admin/base_site.html" %}

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


{% block breadcrumb_items %}
  {% for app in app_list %}
    <li class="breadcrumb-item active" aria-current="page">
      <span>{{ app.name }}</span>
    </li>
  {% endfor %}
{% endblock %}


{% block content_title %}
  <h1>
    {% for app in app_list %}
      {{ app.name }}
    {% endfor %}
  </h1>
{% endblock %}


{% block content %}
  {% for app in app_list %}
    <table class="paper-table table table-hover">
      <thead>
      <tr>
        <th scope="col">{{ _("content type")|capfirst }}</th>
        <th scope="col">{{ _("Add") }}</th>
        <th scope="col">{{ _("Change") }}</th>
      </tr>
      </thead>

      <tbody>
      {% for model in app.models %}
        <tr>
          {% if model.admin_url %}
            <td>
              <a href="{{ model.admin_url }}">
                {{ model.name }}
              </a>
            </td>
          {% else %}
            <td>
              {{ model.name }}
            </td>
          {% endif %}

          {% if model.add_url %}
            <td>
              <a href="{{ model.add_url }}" class="btn btn-sm btn-success">
                {{ _("Add") }}
              </a>
            </td>
          {% else %}
            <td>
              <small class="text-muted">{{ _("None available") }}</small>
            </td>
          {% endif %}

          {% if model.admin_url %}
            <td>
              <a href="{{ model.admin_url }}" class="btn btn-sm btn-success">
                {{ _("Change") }}
              </a>
            </td>
          {% else %}
            <td>
              <small class="text-muted">{{ _("None available") }}</small>
            </td>
          {% endif %}
        </tr>
      {% endfor %}
      </tbody>
    </table>
  {% endfor %}
{% endblock %}
