{% set active_class = 'bg-warning' if project.main_config.get_subproject(inpath=item.path) else '' %}
{% if item.type == 'folder' %}
<li class="list-group-item {{ active_class }} folder">
    <div class="d-flex justify-content-between align-items-center">
        <span>
            <a href="#" class="badge text-dark show-files" title="Show files">
                <span class="bi bi-eye-slash-fill"></span>
            </a>
            <span class="bi-folder-fill"></span>
            {{ item.name }}
            <a href="#" class="badge text-dark select-folder" title="Select folder"
                data-url="{{ url_for('set_configs', projectname=project.name) }}">
                {% if project.main_config.get_subproject(inpath=item.path) %}
                <span class="bi bi-circle-fill" data-path="{{ item.path }}"></span>
                {% else %}
                <span class="bi bi-circle" data-path="{{ item.path }}"></span>
                {% endif %}
            </a>
            <span class="spinner-border spinner-border-sm" style="display:none;"></span>
        </span>
        <span>
            <span class="badge bg-primary rounded-pill">{{ item.children.count }}</span>
        </span>
    </div>
    {% for child in item.children.list %}
    {% with item=child %}
    <ul class="list-group list-group-flush">
        {% include 'file_tree.html' %}
    </ul>
    {% endwith %}
    {% endfor %}
</li>
{% else %}
<li class="list-group-item p-0 ps-3 m-0 small text-muted {{ active_class }} file" style="display: none;">
    <span class="bi-file-earmark-text-fill"></span>
    {{ item.name }}
    </span>
</li>
{% endif %}