{# Renders the LogixNG programs. One card per program, showing the enabled state, conditional count, and a summary of each conditional's action tree. Every action is fire-and-forget from the user's seat — the server awaits before responding. #}
{% if create_error %}
Couldn't create: {{ create_error }}
{% endif %} {% if run_error %}
Run failed: {{ run_error }}
{% endif %} {% if not programs %}

No LogixNG programs defined yet. Create one above, or use the JSON API to upload a full tree.

{% else %} {% for p in programs %}

{{ p.name }} {% if p.userName %} -- {{ p.userName }} {% endif %}

{% if p.enabled %} enabled {% else %} disabled {% endif %} {{ p.conditionals|length }} conditional{% if p.conditionals|length != 1 %}s{% endif %} {% if p.enabled %} {% else %} {% endif %}
{% if p.conditionals %} {% for c in p.conditionals %} {% endfor %}
ConditionalEnabledActions
{% if c.user_name %}{{ c.user_name }}
{% endif %} {{ c.id }}
{% if c.enabled %}yes{% else %}no{% endif %} {% if c.actions %} {% for a in c.actions[:5] %} {{ a.type }}{% if not loop.last %} · {% endif %} {% endfor %} {% if c.actions|length > 5 %} · … ({{ c.actions|length - 5 }} more){% endif %} {% else %} no actions {% endif %}
{% endif %}
{% endfor %} {% endif %}