{#
macros/badges.html — centralised badge macros for MedCover.
Design rules enforced here so templates never need to think about them:
- bg-warning/bg-info always paired with text-black (CSS-variable aware)
instead of text-dark (fixed dark color, not dark-mode aware).
- bg-body-secondary used for neutral/muted backgrounds (dark-mode safe).
- Never use bg-light or bg-white in app templates.
#}
{# ── Generic semantic badges ──────────────────────────────────────────────── #}
{% macro badge_success(text, extra_classes='') %}
{% endmacro %}
{% macro badge_danger(text, extra_classes='') %}
{% endmacro %}
{% macro badge_warning(text, extra_classes='') %}
{% endmacro %}
{% macro badge_secondary(text, extra_classes='') %}
{% endmacro %}
{% macro badge_info(text, extra_classes='') %}
{% endmacro %}
{# ── Event / ME status badge ──────────────────────────────────────────────── #}
{#
status_colors is a dict mapping status value strings to Bootstrap colour names,
e.g. {'Zveřejněno': 'success', 'Koncept': 'secondary', ...}.
Pass the same dict that routes already compute and inject into the template.
#}
{% macro badge_status(status_value, status_colors, extra_classes='') %}
{% endmacro %}
{# ── Debriefing grade badge ───────────────────────────────────────────────── #}
{#
grade: int 1–5. ≤2 = good (green), 3 = ok (warning), ≥4 = poor (danger).
#}
{% macro badge_grade(grade) %}
{{ grade }}/5
{% endmacro %}