{# The health card — crate::pages::admin::ecb::ui::StatusFragment, and what ecb.html embeds on first load. It carries its own poll trigger rather than the page carrying it, so the trigger travels with each swap: while a batch is running the card asks for itself every few seconds, and the card that comes back after the batch finishes has no trigger, which is what stops the polling. #}

{{ page.headline() }} {% if page.import_running %}{{ nav.tr("ecb-import-running") }}{% endif %}

{{ page.explanation() }}

{{ nav.tr("ecb-postable-lead") }}

{% if let Some(through) = page.transactions_postable_through %}
{{ nav.tr("ecb-ordinary-transactions") }}
{{ nav.tr("ecb-dated-up-to") }} {{ through }}
{{ nav.tr("ecb-statements-title") }}
{{ nav.tr("ecb-dated-up-to") }} {{ page.statements_postable_through.as_deref().unwrap_or("—") }}
{% else %}

{{ nav.tr("ecb-nothing") }} {{ nav.tr("ecb-no-publication-hint") }}

{% endif %}
{{ nav.tr("ecb-verified-through") }}
{% if let Some(date) = page.verified_through_date %}{{ date }}{% else %}{{ nav.tr("ecb-never") }}{% endif %}
{{ nav.tr("ecb-last-success") }}
{% if let Some(when) = page.last_success() %}{{ when }}{% else %}{{ nav.tr("ecb-none") }}{% endif %}
{{ nav.tr("ecb-next-import") }}
{{ page.next_import() }}
{% if !page.covered_currencies.is_empty() %}
{{ nav.tr("ecb-ready-currencies") }} {% for currency in page.currencies() %}{{ currency }}{% endfor %}
{% endif %} {% if !page.healthy %} {% if let Some(failure) = page.last_failure() %}

{{ nav.tr("ecb-latest-problem") }} {% if let Some(message) = failure.error_message %}{{ message }}{% else %}{{ nav.tr("ecb-no-reason-recorded") }}{% endif %}

{% endif %} {% endif %}