{# UI utility macros: empty_state, card, status_dot, task_status_badge, task_status_text. #} {% from "_macros.html" import icon %} {% macro empty_state(text, icon=None, class='') %}

{% if icon %}{% endif %}{{ text }}

{% endmacro %} {% macro card(title) %}
{{ title }}
{% if caller is defined %}{{ caller() }}{% endif %}
{% endmacro %} {% macro status_dot(ch) %} {% if ch.is_filtered %} {% elif ch.is_active %}{{ icon("active") }} {% else %}{% endif %} {% endmacro %} {% macro task_status_badge(task) %} {% if task.status == 'running' %} {% elif task.status == 'completed' %} OK {% elif task.status == 'failed' %} Ошибка {% elif task.status == 'cancelled' %} Отменена {% else %} Ожидание {% endif %} {% endmacro %} {% macro task_status_text(task) %} {% if task.status == 'running' %} Выполняется {% elif task.status == 'completed' %} Завершено {% if task.note %}
{{ task.note }}{% endif %} {% elif task.status == 'failed' %} Ошибка {% if task.error %}
{{ task.error[:100] }}{% endif %} {% elif task.status == 'cancelled' %} Отменена {% if task.note %}
{{ task.note }}{% endif %} {% else %} {% if task.run_after %} Ожидание до {{ task.run_after|local_dt }} {% else %} Ожидание {% endif %} {% if task.note %}
{{ task.note }}{% endif %} {% endif %} {% endmacro %}