{# 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 %}
{% 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. #}
HomeMarketplaceData Packages
{# 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
{% 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('/activity') %}