{% load i18n ui %}{% comment %} The sector job's progress (step 5, #90), polled by htmx while it is queued or running (stations:sector_progress, outerHTML swap). When the job has finished the view answers with HX-Redirect to the sector page, which shows the results or the error. Built from the progress and stages components, as stations/_results_progress.html. Parameters: job, analysis, phases, and jobs.views.progress_context. {% endcomment %}
{% if job.status == "queued" or job.status == "running" %}
{% if stage_label %}{{ stage_label }}{% else %}{{ job.get_status_display }}{% endif %} {% if job.total %}{% blocktranslate with percent=job.percent %}{{ percent }}%{% endblocktranslate %}{% endif %}
{% blocktranslate with percent=job.percent %}{{ percent }}%{% endblocktranslate %}

{% if job.total %}{% blocktranslate with step=job.step total=job.total %}Step {{ step }} of {{ total }}.{% endblocktranslate %}{% else %}{{ job.get_status_display }}{% endif %} {% if elapsed %}{% blocktranslate %}Time so far: {{ elapsed }}.{% endblocktranslate %}{% endif %} {% if remaining %}{% blocktranslate %}About {{ remaining }} left.{% endblocktranslate %}{% endif %}

{% translate "Stages of the calculation" as stages_label %} {% include "components/stages.html" with label=stages_label stages=phases %} {% if worker_missing %} {% translate "No calculation worker is running, so this job cannot start yet. If you run Climpact yourself, restart it with the climpact-web command." as worker_message %} {% include "components/alert.html" with kind="warning" message=worker_message title="" %} {% endif %} {% if job.cancel_requested %}

{% translate "Cancelling…" %}

{% endif %} {% if job.can_cancel %}
{% csrf_token %} {% translate "Cancel" as cancel_label %} {% include "components/button.html" with label=cancel_label type="submit" variant="secondary" size="sm" icon="close" %}
{% endif %} {% endif %}