{% load i18n brickwork_icons %} {% comment %} Recursive nav render (NAV-016: one render shared by desktop sidebar + mobile drawer). Uses Django 6.0 {% partialdef %} for the recursive item partial; brickwork is the first umbrella package to use the 6.0 template partials, so there is no django-cotton / django-render-block here (BR-BW-TPL-003/004). Items arrive already prepared by {% bw_nav %} (URL resolved via safe_reverse, active/ancestor-active state and the disabled/external flags computed), so this template is pure presentation: no {% url %} that could 500 (BR-BW-NAV-003), no permission logic (visibility was filtered upstream). {% endcomment %} {% partialdef nav_item %} {% comment %} `item` is a RenderedNavItem. {% endcomment %} {% if item.is_section_header %}
  • {{ item.label }} {% if item.children %} {% endif %}
  • {% else %}
  • {% if item.is_disabled %} {% if item.icon %}{% bw_icon item.icon decorative=True css_class="bw-nav__icon" %}{% endif %} {{ item.label }} {% else %} {% if item.icon %}{% bw_icon item.icon decorative=True css_class="bw-nav__icon" %}{% endif %} {{ item.label }} {% if item.badge is not None %}{{ item.badge }}{% endif %} {% if item.is_external %}{% bw_icon "external-link" size="sm" decorative=True css_class="bw-nav__external" %}{% endif %} {% endif %} {% if item.children %} {% endif %}
  • {% endif %} {% endpartialdef %}