{# partials/_macros.html — shared Jinja2 macros #}
{% macro entry_state(entry) %}
{%- if entry.success %}success
{%- elif entry.guardrail %}guardrail
{%- elif entry.error and entry.error != '' %}error
{%- elif entry.success is none %}unjudged
{%- else %}failure{%- endif -%}
{% endmacro %}
{% macro entry_label(entry) %}
{%- if entry.success %}SUCCESS
{%- elif entry.guardrail %}GUARDRAIL
{%- elif entry.error and entry.error != '' %}ERROR
{%- elif entry.success is none %}UNJUDGED
{%- else %}FAILED{%- endif -%}
{% endmacro %}
{% macro status_badge(status) %}
{%- if status == 'running' -%}
Running
{%- elif status == 'success' -%}
Success
{%- else -%}
Errored
{%- endif -%}
{% endmacro %}
{% macro type_badge(type) %}
{%- if type == 'generate' -%}
Generate
{%- elif type == 'manual' -%}
Manual
{%- elif type == 'script' -%}
Script
{%- else -%}
Test
{%- endif -%}
{% endmacro %}