{# Category-filter sidebar for admin product listings. Clicking a category reloads the page with `?category=` so the table server-side filters to that category and its descendants. Expects in context: - category_groups: [{ id, name, count, children: [{ id, name, count }] }] (from views::shop::admin_category_groups) - selected_category: "all" | "none" | "" — the active filter - total_count, uncategorized_count: ints - category_base: page path, e.g. "/admin/catalog/products" - category_suffix: extra query appended after the category param, e.g. "&audience=business", or "" — set by the including template. The link treatment mirrors shop/_sidebar.html (Penguin UI), but active state is server-driven via aria-current (these links share a path, differing only by query, so markActiveNav() can't pick the active one — hence no data-nav). Numeric compare uses `| int(default=0)` because Tera string==number is false. #} {% set sel = selected_category | int(default=0) %} {% set link_cls = "flex flex-1 items-center gap-2 truncate rounded-radius px-2 py-1.5 text-sm font-medium text-on-surface underline-offset-2 transition hover:bg-primary/5 hover:text-on-surface-strong focus:outline-hidden focus-visible:underline aria-[current=page]:bg-primary/10 aria-[current=page]:text-on-surface-strong dark:text-on-surface-dark dark:hover:bg-primary-dark/5 dark:hover:text-on-surface-dark-strong dark:aria-[current=page]:bg-primary-dark/10 dark:aria-[current=page]:text-on-surface-dark-strong" %}