{# Unified status badge macro for consistent styling across pynmon. The status palette lives in pynmon.util.status_colors and is injected by pynmon.app. #} {% macro status_badge(status, size='normal') -%} {% set raw_status = status if status is not none else 'unknown' %} {% set status_name = raw_status if raw_status is string else raw_status.name|default(raw_status|string, true) %} {% set status_label = status_name|string|trim %} {% set status_label = status_label if status_label else 'unknown' %} {% set colors = get_status_colors(status_label) %} {% set size_class = 'badge-sm' if size == 'small' else '' %} {{ status_label|upper }} {%- endmacro %} {% macro status_color(status) -%} {{ get_status_colors(status).hex_color }} {%- endmacro %}