<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8"/>
  <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
  <link rel="icon" href="/favicon.ico" type="image/x-icon"/>
  <link rel="stylesheet" href="{{document.meta.get_root_path_prefix()}}/_static/global.css" />
  <link rel="stylesheet" href="{{document.meta.get_root_path_prefix()}}/_static/layout-main-with-toc.css" />
  <script type="text/javascript" src="{{document.meta.get_root_path_prefix()}}/_static/toc.js"></script>
  <title>{{document.name}} - Table</title>
</head>

<body class="table">

  {%- set document_iterator = traceability_index.get_document_iterator(document) -%}

  <div id="toc_layout" class="layout-with-toc">

    <aside class="toc">
      {% include "_shared/table_of_contents.jinja.html" %}
    </aside>

    <main class="content">
      <header class="document-header">
        {{document.name}} <span class="document-view-type">Table</span>
      </header>

      {% include "_shared/tags.jinja.html" %}

      <article class="view-table" id="sections-and-requirements">

        {%- if document.free_texts -%}
        <section>
          {%- for free_text in document.free_texts -%}
          <div class="free_text">
            {{ renderer.render_free_text(free_text) }}
          </div>
          {%- endfor -%}
        </section>
        {%- endif -%}

      {%- for section_or_requirement in document_iterator.all_content() %}

        {%- if section_or_requirement.is_composite_requirement %}
        <section class="view-table_composite" id="{{ link_renderer.render(section_or_requirement) }}">
          {%- set section = section_or_requirement %}
          <h{{ section.ng_level }} class="section-title" data-level="{{ section.context.title_number_string }}">
            {{ section.title if section.title else '' }}
          </h{{ section.ng_level }}>

          {%- set requirement = section_or_requirement %}
          {% with requirement_view_type='table' -%}
          {% include "_shared/requirement.jinja.html" %}
          {%- endwith %}
        </section>

        {%- elif section_or_requirement.is_requirement %}
        <section class="view-table_requirement" id="{{ link_renderer.render(section_or_requirement) }}">
          {%- set requirement = section_or_requirement %}
          {% with requirement_view_type='table' -%}
          {% include "_shared/requirement.jinja.html" %}
          {%- endwith %}
        </section>

        {%- elif section_or_requirement.is_section %}
        <section class="view-table_section" id="{{ link_renderer.render(section_or_requirement) }}">
          {%- set section = section_or_requirement %}
          <h{{ section.ng_level }} class="section-title" data-level="{{ section.context.title_number_string }}">
            {{ section.title if section.title else '' }}
          </h{{ section.ng_level }}>
          {%- for free_text in section_or_requirement.free_texts %}
          <div class="free_text">
            {{ renderer.render_free_text(free_text) }}
          </div>
          {%- endfor -%}
        </section>
        {%- endif %}

      {%- endfor %}
      </article>

    </main>

  </div>
</body>
</html>
