{# Reusable Jinja macros for TG Agent templates. #} {% macro icon(name) %}{% endmacro %} {% macro filter_flags(flags_str, margin='') %} {% if flags_str %} {% for flag in flags_str.split(',') %} {% set f = flag.strip() %} {% if f in filter_flag_emoji %} {{ filter_flag_emoji[f][0] }} {% else %} {% endif %} {% endfor %} {% else %} {% endif %} {% endmacro %} {% macro channel_actions(ch, prefix='') %} {% if ch.message_count > 0 %} {{ icon("view") }} {% endif %} {% if ch.is_filtered %}
{% if ch.message_count > 0 %} {% endif %} {% endif %} {% endmacro %} {% macro pipeline_actions(pipeline, needs_llm=true, llm_configured=true) %} {% set llm_blocked = needs_llm and not llm_configured %} {# Edit #} {{ icon("edit") }} {# Generate #} {% if needs_llm and not llm_blocked %} {{ icon("generate") }} {% elif needs_llm and llm_blocked %} {{ icon("generate") }} {% endif %} {# Dry run (тест без публикации) #} {# Toggle active #} {# Export JSON #} {{ icon("export") }} {# AI edit (DAG pipelines with LLM) #} {% if pipeline.pipeline_json and llm_configured %} {% endif %} {# Delete #} {% endmacro %}