{% comment %} One run of sidebar rows, for both sets of them: the product's nav and, on a settings page, the settings nav (see partials/_app_sidebar.html). Both are the NavGroup/NavItem structure from apps.common.context_processors, with `active` already resolved in Python. There were two renderers while the settings nav was a 232px column of its own — partials/_nav_groups.html, with its own row markup, its own group label and its own active class. The rows are in the sidebar now, so the second copy is gone and a settings row gets what every other row here gets: the collapse hooks (`.sidebar-nav-label`, which every collapsed rule keys on, and a `title`, the only affordance left at 60px) without anything having to mirror them. `item.partial` is that last case: a row that is more than an anchor renders itself. Exactly one row uses it — Notifications, which is also the bell's trigger — and the alternative was an `{% if item.key == "notifications" %}` here, in the renderer that is supposed not to know what the rows are. Args: groups: rendered nav groups (each {label, items: [...]}). {% endcomment %} {% for group in groups %} {% if group.label %}
{% endif %} {% for item in group.items %} {% if item.partial %}{% include item.partial with item=item %}{% else %} {% include "partials/_nav_icon.html" with name=item.icon %} {% comment %} The badge is a sibling of the label, not a child of a wrapper round the glyph: expanded it is pushed to the row's far end with `margin-left:auto`, and inside a wrapper that auto margin has nothing to push against. The row is its containing block for the collapsed corner state — see .sidebar-nav-item's position:relative. partials/_nav_badge.html explains why the slot is rendered even at zero. {% endcomment %} {% if item.badge_slot %}{% include "partials/_nav_badge.html" with key=item.key count=item.badge only %}{% endif %} {% endif %} {% endfor %}{% endfor %}