
{%- if not view_object.is_empty_tree() -%}
  <div class="tree">
    {% for folder_or_file in view_object.iterator_files_first() -%}
      {% if folder_or_file.is_folder() %}
        {% if view_object.should_display_folder(folder_or_file) %}
          <div
            class="tree_folder"
            data-level="{{ folder_or_file.level }}"
            data-testid="tree-folder-item"
          >
          {#- {% include "_res/svg__separator.jinja.html" %} -#}
          {# {%- include "_res/svg_ico16_folder.jinja" -%} #}
          <span class="tree_folder_path">/{{- folder_or_file.rel_path -}}</span>
          </div>
        {% endif %}
      {% elif view_object.should_display_file(folder_or_file) %}
        {%- set document_ = view_object.get_document_by_path(folder_or_file.full_path) %}
        {% if not document_.document_is_included() %}
        <a
          href="{{ view_object.document.meta.get_root_path_prefix() }}/{{ document_.meta.get_html_doc_link() }}"
          class="tree_item"
          {% if view_object.document == document_ %}
          active="true"
          {% endif %}
          data-folder="{{ folder_or_file.mount_folder }}"
          data-testid="tree-document-link"
        >
          {% include "_res/svg_ico16_document.jinja.html" %}
          <div
            class="document_title"
            title="{{ document_.title }}"
            data-file_name="{{ folder_or_file.file_name }}"
          >{{ document_.title }}</div>
        </a>
        {% with document=document_ %}
        {% include "screens/document/_shared/project_tree_child_documents.jinja" %}
        {% endwith %}
        {% endif %}
      {% endif %}
    {%- endfor -%}
  </div>
{%- else -%}
  <span data-testid="document-tree-empty-text">🐛 The project has no documents yet.</span>
{%- endif -%}

