{% load i18n %} {% load catalog_tags %} {% comment %} Recursive partial — renders a single `DepNode` plus its children. Required context: - `node` a `core.component_graph.DepNode` - `is_root` bool, True only for the very first call from the parent template; controls whether the root is wrapped in
(we want it always-visible) vs. each child (collapsed by default for big trees). `
` is the platform's native disclosure widget — keyboard-accessible and JS-free. Each branch starts collapsed so the page stays scannable on catalogs with deep dependency chains. {% endcomment %} {% if is_root %} {# Root nodes are not wrapped in
; they always render fully open. #}
  • {{ node.path }} {% if node.children %}
      {% for child in node.children %} {% include "django_cotton_gallery/_dep_tree.html" with node=child is_root=False %} {% endfor %}
    {% else %}

    {% trans "No further dependencies." %}

    {% endif %}
{% else %}
  • {% if node.is_cycle %} {{ node.path }} {% trans "cycle" %} {% elif node.truncated %} {{ node.path }} {% trans "depth limit" %} {% elif node.children %}
    {{ node.path }} {{ node.children|length }}
      {% for child in node.children %} {% include "django_cotton_gallery/_dep_tree.html" with node=child is_root=False %} {% endfor %}
    {% else %} {{ node.path }} {% endif %}
  • {% endif %}