<div class="main">
  <div class="std-tree">
    <ul class="std-tree_ul_0">
      {%- for folder_or_file in view_object.traceability_index.document_tree.source_tree.file_tree.iterate_directories(): -%}
      {%- set last_class_or_none = '' -%}
      {%- if loop.last or (loop.nextitem and loop.nextitem.level < folder_or_file.level) -%} {%- set
        last_class_or_none='last-in-level' -%} {%- endif -%} <li class="std-tree_level_{{ folder_or_file.level }}">
        <div class="std-tree_row">
          {%- if folder_or_file.is_folder(): %}
          <div class="std-tree_folder">
            <i class="std-tree_ico">
              <svg class="ico__folder" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="16px"
                height="16px">
                <path d="M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z" />
              </svg>
            </i>
            <div class="std-tree_name">{{ folder_or_file.folder_name }}/</div>
          </div>
          {% else %}
          {%- set source_file = view_object.traceability_index.document_tree.source_tree.get_source_for_file(folder_or_file) -%}
          <div class="std-tree_file">
            <i class="std-tree_ico">
              <svg class="ico__file" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="16px"
                height="16px">
                <path
                  d="M14.17,5L19,9.83V19H5V5L14.17,5L14.17,5 M14.17,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V9.83 c0-0.53-0.21-1.04-0.59-1.41l-4.83-4.83C15.21,3.21,14.7,3,14.17,3L14.17,3z M7,15h10v2H7V15z M7,11h10v2H7V11z M7,7h7v2H7V7z" />
              </svg>
            </i>
            <div class="std-tree_name">
              {%- if source_file.is_referenced -%}
              <a href="{{ view_object.link_renderer.render_source_file_link_from_root_2(source_file) }}">{{
                folder_or_file.get_file_name() }}</a>
              {%- else -%}
              {{ folder_or_file.get_file_name() }}
              {%- endif -%}
            </div>
          </div>
          <div class="std-tree_aside">
            {%- if source_file.is_referenced -%}
            {%- set general_reqs, range_reqs =
            view_object.traceability_index.get_source_file_reqs(source_file.in_doctree_source_file_rel_path_posix) -%}
            {%- if range_reqs -%}
            {%- set coverage_info =
            view_object.traceability_index.get_coverage_info(source_file.in_doctree_source_file_rel_path_posix) -%}
            <div class="value-bar">
              <span class="value-bar_bar" data-value={{ coverage_info.get_coverage() }}>
                <span class="value-bar_filler" style="width:{{ coverage_info.get_coverage() }}%"></span>
              </span>
              <span class="value-bar_text">{{ coverage_info.get_coverage() }}%</span>
            </div>
            {%- elif general_reqs -%}
            <div class="value-bar">
              <span class="value-bar_bar" data-value>
                <span class="value-bar_filler"></span>
              </span>
              <span class="value-bar_text"></span>
            </div>
            {%- else -%}
            <div class="value-bar">
              <span class="value-bar_bar">
                <span class="value-bar_filler"></span>
              </span>
              <span class="value-bar_text"></span>
            </div>
            {%- endif -%}
            {%- else -%}
            <div class="value-bar">
              <span class="value-bar_bar">
                <span class="value-bar_filler"></span>
              </span>
              <span class="value-bar_text"></span>
            </div>
            {%- endif -%}
          </div>
          {% endif %}
        </div>
        {%- if not loop.last -%}
        {%- if loop.nextitem.level > folder_or_file.level -%}
        <ul class="std-tree_ul_{{ folder_or_file.level + 1 }}">
          {%- elif loop.nextitem.level < folder_or_file.level -%} </li>
            {%- for x in range(0, folder_or_file.level - loop.nextitem.level) -%}
        </ul>
        </li>
        {%- endfor -%}
        {%- else -%}
        </li>
        {%- endif -%}
        {%- else -%}
        </li>
        {%- for x in range(0, folder_or_file.level) -%}
    </ul>
    </li>
    {%- endfor -%}
    {%- endif -%}
    {%- endfor -%}
    </ul>
  </div>
</div>
{# /.main #}
