{# ---- Heroicons (outline, MIT) as inline SVG — no build step needed ---- #} {% macro icon(name, cls="w-4 h-4") -%} {%- endmacro %} {# One job as a native
accordion row. `state` keys the per-row actions (use the job's own state for search results that span states). #} {% macro job_row(name, j, state, page=1) -%}
{{ icon('chevron', 'w-4 h-4') }} #{{ j.id }} {{ j.name }} {{ j.data|tojson }} {% if j.progress is number %} {% endif %} {{ j.attempts_made }}×
{% if state == 'delayed' %} {% endif %} {% if state == 'failed' %} {% endif %}
{%- endmacro %} {# state -> semantic status token (one token per state; see styles/input.css) #} {% macro state_token(s) -%} {%- if s == 'active' -%}info {%- elif s == 'completed' -%}success {%- elif s == 'failed' -%}danger {%- elif s == 'delayed' -%}warning {%- else -%}muted {%- endif -%} {%- endmacro %} {# state -> solid progress-bar color #} {% macro bar_color(s) -%}bg-{{ state_token(s) }}{%- endmacro %} {# state -> pill colors (one token, three fixed intensities; both themes) #} {% macro state_color(s) -%} {%- set c = state_token(s) -%}text-{{ c }} bg-{{ c }}/10 ring-{{ c }}/30 {%- endmacro %} {# A clickable job-id chip → the standalone job page. Import `with context` (url_for). #} {% macro job_chip(queue, jid) -%} {% set href = url_for('job_page', name=queue, job_id=jid).path %} #{{ jid }} {%- endmacro %}