{% from "fragments/_chips.html" import chip, needs_review_chip %} {% macro run_row(it, progress, now, csrf_requeue, oob=false, just_finished=false) %}
{{ it.run_id.hex[:8] }}
{% if it.status == "running" and progress %}
{{ humanize_stage_progress(progress.stage) }}{% if progress.overrun %} · taking longer{% else %} ~{{ progress.percent }}%{% endif %}
{% else %}
{{ humanize_status(it.status) }}
{% endif %}
{% if it.archived %}archived{% endif %}
{% if it.status == "completed" %}
{% if it.label_count == 0 %}no speakers
{% elif it.unresolved_count > 0 %}{{ needs_review_chip(it.unresolved_count) }}
{% else %}{{ chip("reviewed") }}{% endif %}
{% elif it.status == "failed" and it.error %}
{{ humanize_error(it.error) or "—" }}
{% else %}—{% endif %}
{% if it.claim_live %}claimed{% if it.claimed_by %} · {{ it.claimed_by }}{% endif %}{% endif %}
{% if it.language %}{{ language_label(it.language) }}{% else %}—{% endif %}
{% if it.status in ("completed", "failed") and it.elapsed_seconds is not none %}
{{ format_compact_duration(it.elapsed_seconds|int) }}
{% elif it.status == "running" and it.elapsed_seconds is not none %}
{{ format_compact_duration(it.elapsed_seconds|int) }}
{% else %}—{% endif %}
{{ format_age(it.created_at, now=now) }}
{% if it.status == "completed" and it.unresolved_count > 0 %}
Review →
{% elif it.status == "failed" and not it.archived %}
{% elif it.status == "failed" %}
View →
{% else %}
View →
{% endif %}