{# Renders one import job as a compact summary line that expands (click it) to reveal the output `
`.
Interactive controls — the candidate chooser, abort, or the decision spinner — appear beneath the summary
when applicable. Dispatches on job.status: polls while running (or while a submitted decision is being
consumed). Swapped via hx-swap="outerHTML". #}
{% set awaiting_answer = job.status == 'awaiting_decision' and not job.decision_submitted %}
{% set polling = job.status in ('pending', 'running') or (job.status == 'awaiting_decision' and job.decision_submitted) %}
{{ job.source_label }} — status: {{ job.status }} · job {{ job.id[:8] }}
{{ job.output or '(no output yet.)' }}
{% if job.status in ('pending', 'running') %}
{% elif awaiting_answer and job.pending_decision %}
{% set decision = job.pending_decision %}
{{ decision.prompt }}
{% if candidate_table %}
{# keep a wide candidate table from overflowing the layout #}
{% for header in candidate_table.headers %}{{ header }} {% endfor %}
{# Apply column #}
{% for row in candidate_table.rows %}
{% for cell in row.cells %}
{% if cell.url %}{{ cell.text }}{% else %}{{ cell.text }}{% endif %}
{% endfor %}
{% endfor %}
{% else %}
No candidate matches were found.
{% endif %}
{% elif job.status == 'awaiting_decision' %}
Applying your decision …
{% elif job.error %}
Error: {{ job.error }}
{% endif %}