{% extends "web/_base.html" %}
{% block navbar_left %}
    {{ block.super }}
    {% include "web/_workspace-menu.html" with workspace=workspace only %}
{% endblock %}
{% block title %}Workspace {{ workspace.name }}{% endblock %}
{% block content %}
    <h1>{{ workspace.name }} workspace</h1>
    <h2>Details</h2>
    <table class="table table-hover">
        <tbody>
            <tr>
                <th>Public</th>
                <td>{{ workspace.public|yesno:"yes,no" }}</td>
            </tr>
            <tr>
                <th>Default expiration delay (days)</th>
                <td>{{ workspace.default_expiration_delay.days|default:"Never" }}</td>
            </tr>
        </tbody>
    </table>
    {% if collection_stats %}
        <h2>Collections</h2>
        <table class="table table-hover">
            <thead>
                <tr>
                    <th>Category</th>
                    <th>Count</th>
                </tr>
            </thead>
            <tbody>
                {% for s in collection_stats %}
                    <tr>
                        <td>
                            <a href="{% url 'workspaces:collections:category_list' wname=workspace.name ccat=s.category %}">{{ s.category }}</a>
                        </td>
                        <td>{{ s.count }}</td>
                    </tr>
                {% endfor %}
            </tbody>
            <tfoot>
                <tr>
                    <td>
                        <a href="{% url 'workspaces:collections:list' wname=workspace.name %}">All collections</a>
                    </td>
                    <td>{{ collection_count }}</td>
                </tr>
            </tfoot>
        </table>
    {% endif %}
{% endblock %}
