{# Shared modern header — used by base.html and dashboard.html. Styles live in app/web/static/style-custom.css under the .app-* prefix. #} {% if session.user %}
{% if config.INSTANCE_SUBTITLE %}{{ config.INSTANCE_SUBTITLE }}{% endif %}
{% set _path = request.url.path %} {% set _home = home_route or '/dashboard' %} {# Primary nav: Home → Marketplace → Data Packages → Memory. Activity Center moved into the Admin dropdown — its content is per-team adoption analytics that only admins consume in practice (the route still allows any authed user for direct deep-links). The "Home" link points at the operator-resolved `home_route` (defaults to /dashboard for OSS; customer instances flip to /home via env / yaml). Setup local agent + My Stack used to live in the nav too; Setup is reached from /home's install flow and My Stack lives inside /marketplace as a tab. #} Home Marketplace Data Packages Stats {# Memory + Admin menu: both admin-only. Backend gates the routes themselves via require_admin (see app/web/router.py for /corporate-memory + /corporate-memory/admin + /admin/*), so hiding the links is purely a visibility tidy-up — non-admins who deep-link still get a 403 from the route handler. Single guard wraps both for clarity. #} {% if session.user.is_admin %} {# "Memory" link moved into the Admin dropdown's Agent Experience section (parallel to Curated Marketplaces / Flea Submissions / Prompts). The primary nav no longer carries an admin-only entry — primary nav stays consistently visible to all authenticated users. #} {% set _admin_active = _path.startswith('/admin/tables') or _path.startswith('/admin/tokens') or _path.startswith('/admin/users') or _path.startswith('/admin/groups') or _path.startswith('/admin/access') or _path.startswith('/admin/server-config') or _path.startswith('/admin/agent-prompt') or _path.startswith('/admin/workspace-prompt') or _path.startswith('/admin/marketplaces') or _path.startswith('/admin/store') or _path.startswith('/admin/scheduler-runs') or _path.startswith('/admin/activity') or _path.startswith('/admin/telemetry') or _path.startswith('/admin/usage') or _path.startswith('/admin/sessions') or _path.startswith('/corporate-memory') %}
{# Admin dropdown is grouped into four named sections so admins doing different jobs (debugging activity vs. managing users vs. curating marketplaces) can land on the right page without re-reading the full menu. Section headers are non-clickable, set off by `.app-nav-menu-section` styling (small caps, muted). Items keep the existing `.app-nav-menu-item` look + active state. #}
{% endif %}
{# Dropdown wiring lives in app/web/static/app.js. The script tag sits here (in the shared header partial) instead of base.html so EVERY page that includes _app_header.html — including standalone pages like catalog.html / corporate_memory*.html / install.html / admin_tables.html that don't extend base.html — gets the JS loaded automatically. Defer keeps it non-blocking; placed after the header markup so DOM is ready by the time the IIFE runs init(). #} {% endif %}