{% extends "base.jinja.html" %}
{% block head_scripts %}
  <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>
  {{ super() }}
{% endblock head_scripts %}
{% block title %}Deep Traceability{% endblock title %}
{% block viewtype %}deep-traceability-view{% endblock %}

{% block content %}

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

      <div class="content">
      {%- for section_or_requirement in document_iterator.all_content() %}
        {%- if section_or_requirement.is_requirement %}
        <section class="content_section">

          <div class="content_item" data-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="content_item" data-role="current">
            {%- with anchor=link_renderer.render(section_or_requirement) -%}
            {% include "_shared/requirement.jinja.html" %}
            {%- endwith -%}
          </div>

          <div class="content_item" data-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 %}
      </div>

{% endblock content %}
{% block scripts %}
  <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>
{% endblock %}
