<!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/jquery.min.js"></script>
  <script type="text/javascript" src="{{document.meta.get_root_path_prefix()}}/_static/pan-with-space.js"></script>
  <script type="text/javascript" src="{{document.meta.get_root_path_prefix()}}/_static/toc.js"></script>
  <title>{{document.name}} - Deep Traceability</title>
</head>

<body class="deep-traceability">

  {%- 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">Deep Traceability</span>
      </header>

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

      <article class="view-traceability-deep">
      {%- for section_or_requirement in document_iterator.all_content() %}
        {%- if section_or_requirement.is_requirement %}
        <section class="view-traceability-deep_row" id="{{ link_renderer.render(section_or_requirement) }}">

          <div class="view-traceability-deep_column" data-requirement-role="parents">
          {%- for requirement in traceability_index.get_parent_requirements(section_or_requirement) %}
            {% include "single_document_traceability_deep/recursive_cell_parent.jinja.html" %}
          {%- endfor %}
          </div>

          {%- set requirement = section_or_requirement %}
          <div class="view-traceability-deep_column" data-requirement-role="current">
            {% with requirement_view_type='card' -%}
            {% include "_shared/requirement.jinja.html" %}
            {%- endwith %}
          </div>

          <div class="view-traceability-deep_column" data-requirement-role="children">
          {%- for requirement in traceability_index.get_children_requirements(section_or_requirement) %}
            {% include "single_document_traceability_deep/recursive_cell_children.jinja.html" %}
          {%- endfor %}
          </div>

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

    </main>
  </div>

  <script>
    $(document).ready(function () {
      // Quick and dirty scrolling to the middle of the document.
      var table = $('.table').first();
      window.scrollBy(table.outerWidth() / 2 - $(window).width() / 2, 0);
    });
  </script>
</body>
</html>
