{% load controlcenter_tags %}

<table class="controlcenter__table" {% if widget.sortable and widget.items|length > 1 %}data-sortable{% endif %}>
    {% if widget.items and widget.sortable %}
        <thead class="controlcenter__table__thead">
            <tr class="controlcenter__table__tr">
                <th class="controlcenter__table__th controlcenter__table__th--value">{{ widget.value_column_label|default:'Value' }}</th>
            </tr>
        </thead>
    {% endif %}
    <tbody class="controlcenter__table__tbody">
        {% for value in widget.items %}
            <tr class="controlcenter__table__tr">
                <td class="controlcenter__table__td">
                    {% include "controlcenter/snippets/generic_item.html" with item=value %}
                </td>
            </tr>
        {% empty %}
            <tr class="controlcenter__table__tr">
                <td class="controlcenter__table__td controlcenter__table__td--novalues">{{ widget.empty_message }}</td>
            </tr>
        {% endfor %}
    </tbody>
</table>
