{# ATS scan terminal fragment — emitted when the bg thread reports done, error, cancelled, or when the session times out. No hx-trigger — omitting it stops HTMX polling (Phase 4 proven pattern). Auto-dismisses after 8s on success. Lives inside the #scan-result container in companies/index.html. #}
{% if error_msg %} ATS scan failed: {{ error_msg }} {% elif status == 'cancelled' %} {{ message or 'ATS scan cancelled.' }} {% elif result %}
ATS scan complete. Scanned {{ result.companies_scanned }} companies, discovered {{ result.jobs_discovered }} jobs ({{ result.jobs_new }} new). {% if result.html_scraped and result.html_scraped > 0 %} HTML-scraped {{ result.html_scraped }} listings from careers pages. {% endif %} {% if result.errors %} {{ result.errors | length }} errors. {% endif %}
{% else %} {{ message or 'ATS scan finished with no result payload.' }} {% endif %}
{# Auto-dismiss success card after 8s. Skip on error/cancelled so the user has time to read the message. #} {% if not error_msg and status != 'cancelled' %} {% endif %}