{{ flash.level }}
{{ flash.message }}
{{ _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
{% endif %}
{{ 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 %}
{% block content %}{% endblock %}