{% import "macros/image.nunj" as img %}

<div class="Browser-controls">
    <ul class="Browser-tabs">
        {% for panel in frctl.theme.get('panels') %}
        {% if panel == 'resources' %}
        {% for collection in entity.resources().items() %}
        {% if collection.size %}
        <li class="Browser-tab Browser-tab--resources{% if not collection.size %} is-disabled{% endif %}" data-role="tab">
            <a href="#browser-{{ entity.id }}-panel-{{ collection.name }}">{{ collection.label }}</a>
        </li>
        {% endif %}
        {% endfor %}
        {% else %}
        <li class="Browser-tab Browser-tab--{{ panel }}{% if loop.first %} is-active {% endif %}" data-role="tab">
            <a href="#browser-{{ entity.id }}-panel-{{ panel }}">{% if panel == 'html' %}HTML{% else %}{{ panel | capitalize }}{% endif %}</a>
        </li>
        {% endif %}
        {% endfor %}
    </ul>
</div>
