{# Vendored from packages/web/src/governor_web/templates/layout.html @ 19455c57c5a9. Adapted for governor-audit (spec 141): single-user / loopback-only / no auth / no notifications. Sidebar items reduced to Dashboard · Opportunities · Configuration. Drift check: re-pull from upstream if the brand styling diverges; this file is a snapshot, not a runtime import. #} {{ title or "Governor Audit" }} {# Mobile backdrop #} {# ── Sidebar ── #} {% set _path = request.url.path %} {# ── Content wrapper ── #}
{# Mobile top bar #}
Governor Audit v{{ app_version }}
{# Main content #}
{% if flash %}
{{ flash.level }} {{ flash.message }}
{% endif %} {# Spec 161 - project switch/add/delete result banner. #} {% set _proj_ok = request.query_params.get('project_ok') %} {% set _proj_err = request.query_params.get('project_error') %} {% if _proj_ok or _proj_err %}
{{ _proj_err or _proj_ok }}
{% endif %} {# Global scan context - surfaces project / region (and billing project when it differs) once at the top so individual pages don't have to repeat the same orientation strip in every subtitle. Hidden on the onboarding wizard (no config yet). #} {% if config is defined and config %} {# Period chip - prefer the LATEST succeeded ScanRun's actual window (so the chip describes the data on screen right now), and fall back to ``config.scan_defaults.lookback_days`` only when no scan has finished yet (e.g. fresh onboarding) so the chip still renders something meaningful. The DB lookup fails-safe to ``None`` per ``latest_scan_window_fn``. #} {% set _today = audit_now_fn() %} {% set _scan_window = latest_scan_window_fn() %} {% if _scan_window %} {% set _window_start = _scan_window.window_start %} {% set _window_end = _scan_window.window_end %} {% set _lookback = _scan_window.requested_lookback_days %} {% else %} {% set _lookback = config.scan_defaults.lookback_days if config.scan_defaults else None %} {% set _window_start = (_today - timedelta(days=_lookback)) if _lookback else None %} {% set _window_end = _today %} {% endif %}
{# Spec 161 - project switcher replaces the static project label. #} {% include "components/_project_switcher.html" %} · Region {{ config.bigquery_region }} {% if config.billing_project_id and config.billing_project_id != config.gcp_project_id %} · Billing {{ config.billing_project_id }} {% endif %} {% if _window_start and _window_end %} · Period {{ _window_start.strftime("%d/%m/%Y") }} - {{ _window_end.strftime("%d/%m/%Y") }} {% if _lookback %}({{ _lookback }}d){% endif %} {% endif %}
{% endif %}
{% block content %}{% endblock %}