<div class="page-header">
    <h1>{{ databox.get_serialized_server_info() }}<small style="font-size:16px;">{{ "Details" | trans }}</small></h1>
</div>

<table class="table table-bordered detail-table">
    <thead>
        <tr>
            <th class='col'>
                {% if app['request'].query.get('sort') == 'col' %}
                    <img src="/assets/common/images/icons/tsort_desc.gif">
                {% endif %}
                {{ 'Collection' | trans }}
            </th>

            <th class="obj">
                {% if app['request'].query.get('sort') == 'obj' %}
                    <img src="/assets/common/images/icons/tsort_desc.gif">
                {% endif %}
                {{ 'Subdef' | trans }}
            </th>

            <th>{{ 'Number' | trans }}</th>
            <th>{{ 'Weight' | trans }}</th>
        </tr>
    </thead>
    <tbody>
        {% for colName,row in table %}
            {% for subdef in row['medias'] %}
                <tr class="{{ loop.parent.loop.index is even ? "even" : "odd" }}">
                    {% if loop.first %}
                        <td rowspan="{{ row['medias']|length + 1 }}">
                            <h2>{{ colName }}</h2>
                        </td>
                    {% endif %}
                    <td>
                        {{ subdef['subdef_name'] }}
                    </td>
                    <td>
                        {{ subdef['total_subdefs'] }}
                    </td>
                    <td>
                        {{ subdef['total_size']|bytesToAuto }}
                    </td>
                </tr>
            {% endfor %}
                <tr class="{{ loop.index is even ? "even" : "odd" }}">
                    <td><b>{% trans %}Total{% endtrans %}</b></td>
                    <td><b>{{ row['total_subdefs'] }}</b></td>
                    <td><b>{{ row['total_size']|bytesToAuto }}</b></td>
                </tr>
        {% endfor %}
    </tbody>
    <tfoot>
        <tr>
            <th></th>
            <th>{% trans %}Cumulative total{% endtrans %}</th>
            <th>{{ total['total_subdefs'] }}</th>
            <th>{{ total['total_size']|bytesToAuto }}</th>
        </th>
    </tfoot>
</table>

<div>
    <a style="text-decoration:none" class="btn" href="{{ path('admin_database', { 'databox_id' : databox.get_sbas_id() }) }}">{{ 'boutton::retour' | trans }}</a>
</div>