{#
todo: automate thead.jinja and file.jinja th/td generation

  {% set coverage_cols = [
    {"id": "lines_percent", "ext": "%", "class": "value_extended", "check_uncovered": True},
    {"id": "lines_covered", "class": "value_extended", "check_uncovered": True},
    {"id": "lines_total", "class": "value_extended"},
    {"id": "lines_all", "class": "value_extended color-secondary"},
    {"id": "func_percent", "ext": "%", "class": "value_extended"},
    {"id": "func_covered", "class": "value_extended"},
    {"id": "func_total", "class": "value_extended"},
  ] %}

#}

<div class="main">
  {% set root_tree_ = view_object.traceability_index.document_tree.source_tree.file_tree %}

  {% if root_tree_.root_folder_or_file.has_content() %}

    <table class="project_coverage" js-project_coverage>
      {% include "screens/source_file_coverage/thead.jinja" %}
      <tbody>
        {% if root_tree_.root_folder_or_file.is_folder() %}
          {% if root_tree_.root_folder_or_file.has_content() %}
            {% with folder = root_tree_.root_folder_or_file %}
              {% include "screens/source_file_coverage/folder.jinja" %}
            {% endwith %}
          {% endif %}
        {% else %}
          {% with file = root_tree_.root_folder_or_file %}
            {% include "screens/source_file_coverage/file.jinja" %}
          {% endwith %}
        {% endif %}
      </tbody>
    </table>
  {%- else -%}
    <span data-testid="document-tree-empty-text">The document tree has no documents yet.</span>
  {%- endif -%}

</div>
{# /.main #}
