{# One collection's branch of the pane, fetched when it is opened (11f). Each document says where the index stands for it: nothing when it is in step, a letter when not, and the sentence as its tooltip. A group shows the worst beneath it. The filter is a checkbox and a `:has()` rule, so it works without a script. The menu follows the thing it acts on, as a sibling: a `
` inside a `` is content a summary may not hold, and a menu inside a closed folder's `
` would be hidden with its contents. Every entry is a link or a form, so each works without a script; `menu.js` adds right-click and Escape. #} {% macro mark(shown) %}{% if shown %}{{ shown.letter }}{% endif %}{% endmacro %} {% macro menu(name, document_id, add_here, branch=none) %} {% endmacro %} {# A group, drawn by its last part and named by its whole path, with its own documents first and the groups inside it after, each drawn by this same macro. #} {% macro folder(branch) %}
  • {{ icon("chevron-right") }}{{ icon("folder") }}{{ branch.name }}{% if branch.current %}{{ current_version }}{% endif %}{{ branch.count }}{{ mark(branch.mark) }}
      {% for shown in branch.entries %}{{ entry(shown, branch.add_here) }}{% endfor %} {% for child in branch.children %}{{ folder(child) }}{% endfor %}
    {{ menu(branch.group, "", branch.add_here, branch) }}
  • {% endmacro %} {% macro entry(shown, add_here) %}
  • {% if shown.document_id %}{{ icon("file-text") }}{{ shown.title }}{{ mark(shown.mark) }} {{ menu(shown.title, shown.document_id, add_here) }} {% else %}{{ icon("file-text") }}{{ shown.title }}{{ mark(shown.mark) }}{% endif %}
  • {% endmacro %} {# The id is what a finished job's redraw looks for, so a branch is redrawn only once it has been opened. #}
    {% if problem %}

    {{ problem }}

    {% endif %} {% for note in notes %}

    {{ note }}

    {% endfor %} {% if tree.attention %}{% endif %} {% if tree.movable %}{% for name in tree.groups %}{% endif %}
      {% for shown in tree.top.entries %}{{ entry(shown, tree.top.add_here) }}{% endfor %} {% for branch in tree.branches %}{{ folder(branch) }}{% endfor %}
    {# A move changed what the pane counts and what is behind its index. #} {% if moved %}{% include "shell-redraws.html" %}{% endif %}