{# Shared pieces of the routine pages: schedule, outputs, status of the last run. #} {% from "ui.html" import when with context %} {# "Every Monday at 06:00", in the space's time zone. #} {% macro schedule(r, weekdays) -%} {%- if r.frequency == 'daily' -%}{{ _("Every day at {time}", time=r.at) }} {%- elif r.frequency == 'weekly' -%}{{ _("Every {day} at {time}", day=_(weekdays[r.weekday or 0]), time=r.at) }} {%- else -%}{{ _("On day {n} of every month at {time}", n=r.monthday, time=r.at) }}{%- endif -%} {%- endmacro %} {# Chosen outputs, as pills. #} {% macro outputs(r, wiki="") -%} {%- endmacro %} {# Status of a run, for the list: colored dot, date, cause of a failure. #} {% macro last_run(run) -%} {%- if run is none -%}{{ _("Never run") }} {%- elif run.status == 'running' -%}{{ _("Running…") }} {%- elif run.status == 'failed' -%}{{ (_("Failed on {when}")|e).format(when=when(run.started_at)) }} {%- else -%}{{ (_("Last run on {when}")|e).format(when=when(run.started_at)) }}{%- endif -%} {%- endmacro %}