{% extends base_template %}
{% block content %}
    <form method="post">
        {% csrf_token %}
        <p class="fs-3">
            <span class="text-danger">Delete</span> collection <b>{{ collection }}</b>?
        </p>
        {% if items_total == 0 %}
            <p id="collection-is-empty">The collection is empty.</p>
        {% else %}
            <p id="collection-contains-items">
                The collection contains <b>{{ items_total }}</b> item{{ items_total|pluralize }}:
            </p>
            <table class="table table-sm table-striped">
                <thead>
                    <tr>
                        <th>Type</th>
                        <th>Category</th>
                        <th>Status</th>
                        <th>Count</th>
                    </tr>
                </thead>
                <tbody>
                    {% for stats in item_stats %}
                        <tr>
                            <td>{{ stats.type.name|lower|capfirst }}</td>
                            <td>{{ stats.category }}</td>
                            <td>{{ stats.active|yesno:"active,deleted" }}</td>
                            <td>{{ stats.count }}</td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        {% endif %}
        <div class="btn-group mt-4"
             role="group"
             aria-label="Confirm/cancel buttons">
            <button class="btn btn-danger btn-primary" type="submit">Delete</button>
            <a class="btn btn-primary" href="{{ collection.get_absolute_url }}">Cancel</a>
        </div>
    </form>
{% endblock %}
