{% extends "wagtailadmin/generic/index.html" %}
{% load i18n wagtailadmin_tags %}

{% block listing %}
    <div class="nice-padding">
        {% if collections %}
            <div id="sites-list">
                <table class="listing">
                    <thead>
                        <tr>
                            <th>
                                {% trans "Name" %}
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        {% minimum_collection_depth collections as min_depth %}
                        {% for collection in collections %}
                            <tr>
                                <td class="title">
                                    <div class="title-wrapper">
                                        <a href="{% url 'wagtailadmin_collections:edit' collection.id %}">
                                            {% format_collection collection min_depth %}
                                        </a>
                                    </div>
                                </td>
                            </tr>
                        {% endfor %}
                    </tbody>
                </table>

            </div>
        {% else %}
            {% url 'wagtailadmin_collections:add' as add_collection_url %}
            <p>{% blocktrans %}No collections have been created. Why not <a href="{{ add_collection_url }}">add one</a>?{% endblocktrans %}</p>
        {% endif %}
    </div>
{% endblock %}
