{% macro alert_level(km_left) -%} {% if km_left < 0 %} alert-danger {% elif km_left < 300 %} alert-warning {% else %} alert-success {% endif %} {%- endmacro %} {% macro service_warning() -%}