<!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}} - Traceability</title>
</head>

<body class="document">

  {%- 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}}
      </header>

      <article class="view-document">

        {%- 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() %}
        <section id="{{ link_renderer.render(section_or_requirement) }}">
        {%- if section_or_requirement.is_requirement %}
          {%- set requirement = section_or_requirement %}
          {% with requirement_view_type='block' -%}
          {% include "_shared/requirement.jinja.html" %}
          {%- endwith %}

        {%- elif section_or_requirement.is_section %}
          {%- 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 -%}

        {%- endif %}
        </section>
        {%- endfor %}

      </article>
    </main>

  </div>

</body>
</html>
