{% load i18n catalog_tags %} {% comment %} Sidebar category tree. Rendered once per (signature, language) and cached as HTML by the view (_cached_sidebar_tree). It carries no per-page state — active highlighting is client-side via data attributes — so one render serves every navigation until a component file changes. Caching it keeps Debug Toolbar's Templates panel from snapshotting these ~130 includes on every request. {% endcomment %} {% for cat_name, subcategories in categories.items %}
{% for sub_name, components in subcategories.items %} {% if sub_name %}
{% for comp in components %} {% with counts=lint_summary|lint_counts:comp.path %} {{ comp.name }} {% if counts %}{% include "django_cotton_gallery/_lint_badges.html" with counts=counts %}{% endif %} {% endwith %} {% endfor %}
{% else %} {% for comp in components %} {% with counts=lint_summary|lint_counts:comp.path %} {{ comp.name }} {% if counts %}{% include "django_cotton_gallery/_lint_badges.html" with counts=counts %}{% endif %} {% endwith %} {% endfor %} {% endif %} {% endfor %}
{% endfor %}