{% from "macros/local_datetime.html" import local_datetime %} {% from "components/job_details.html" import job_details_block %} {# show_dismiss=false leaves a finished job without Dismiss (which deletes it), for pages that keep finished runs as history, like Index Photos. #} {% set dismissible = show_dismiss | default(true) %} {# The page the card is shown on, which "Ask Yaffo" attaches. On a page it's that page's path; the card's refresh and Cancel requests pass it back (as `page`), since their own path is /jobs/…. #} {% set help_page = help_page | default(none) or request.path %} {% set status = run_status(job.status, job.error_count, stopped=job.completed_at is not none) %}
{{ status.label }} {{ _("Started:") }} {{ local_datetime(job.started_at or job.created_at) }}
{% if progress >= 100 and has_results and results_route %} {{ _("Show Results") }} {% endif %} {% if assistant_help | default(false) and (job.status == 'FAILED' or job.error or job.error_count) %} {% endif %} {% if show_cancel and (dismissible or not is_finished) %} {% endif %}
{# Translated from the job's kind and counts; the stored `message` is an English note for debugging and the assistant only. #}
{{ job_progress_text(job) }}
{{ (progress / 100) | format_percent(2) }}
{% set problem = problem_text(job) %} {% set details = job_details(job) %} {% if job.error_count or problem or details %}
{% if job.error_count %} {{ ngettext("%(count)s error", "%(count)s errors", job.error_count, count=job.error_count) }} {% endif %} {% if problem %}

{{ problem }}

{% endif %} {% if details %}{{ job_details_block(details, "job-card-details", job.id) }}{% endif %}
{% endif %}