{% comment %} The shell's channel block: what this workspace has connected, then what it could connect next. Studio's sidebar carries the same two sections for social accounts; these are chat channels, and the difference shows in the mark on each row — a social account has a profile picture, a Telegram bot or a sending domain has a platform and a name. Each row is `row`, not `channel`: `{{ channel.url }}` reads better and trips apps/common/tests/test_template_field_access.py, whose sweep cannot tell a dict from a model and sees `channel` — a CharField on NotificationDelivery — with a FieldFile attribute after it. The sweep is right to be blunt about that name; this block just does not need it. Everything comes from apps.common.context_processors._sidebar_channels, gated on `manage_channels` — the key every page behind these rows is gated on — so a viewer who cannot connect a channel sees no block rather than rows that answer 403. Nothing here is a NavItem: a NavItem is a fixed row in a fixed list, and these are per-workspace data. `active` is resolved in Python all the same, so this block follows the one active-state convention the rest of the nav does. Reading `channels.*` is what runs the query behind it — the context processor defers it, because most renders are htmx fragments that draw no sidebar. The block lives inside `.sidebar-nav`, which is what makes the existing collapsed rules apply to its rows without a second copy of them: the glyphs survive at 60px and the labels go. The two headings and the connect list go with them (styles.css, beside the other collapsed rules and their pre-paint twins) — a "Connect channels" list is a reading exercise, not a rail of icons, and Studio hides it in the rail for the same reason. {% endcomment %} {% load common_extras %} {% if channels.connections %} {% for row in channels.connections %} {% comment %} Two states mean the channel is not carrying messages, and they are not the same news: `needs_reauth` is something to fix, `disabled` is somebody's own decision. A revoked channel gets the badge Studio spends on the platform — the platform is already the chip underneath — and a turned-off one is drained of colour instead, which is what "off" looks like everywhere else in the product. {% endcomment %} {% include "partials/_platform_icon.html" with platform=row.platform only %} {% if row.needs_reauth %}{% endif %} {{ row.name }} {% endfor %} {% endif %} {% if channels.connectable %} {% endif %}