{%- import 'ui/kit.html' as kit -%} {%- if spell is none %} {%- call kit.drawer('wands', spell_name) %}

No such spell.

{% endcall %} {%- else %} {%- set su = principal and principal.superadmin %} {%- call kit.drawer('spell (locked)' if locked else ('edit spell' if su else 'spell'), spell.spell) %} {{ kit.kv([('when (action)', spell.action), ('status', 'enabled' if spell.enabled else 'disabled'), ('created by', spell.created_by or '-'), ('created', spell.timestamped|when)]) }} {%- if su %}
{{ chain|tojson_attr }}
{%- if locked %}
This spell has run, so its definition is frozen and can no longer be edited (run history stays an honest audit trail). You can still enable, disable or delete it.
{%- endif %}
{%- if not locked %}{% endif %}
{%- else %}

Only a superadmin can view or change a spell's chain.

{%- endif %}

Recent runs

{%- if not runs %}

No runs yet. Publish a matching event to trigger this spell.

{%- else %} {% for r in runs %} {% endfor %}
wheneventstatusdetail
{{ r.ts|ago }}{{ r.event }}{{ r.status }}{{ r.detail }}
{%- endif %} {%- if su %} {%- endif %} {%- endcall %} {%- endif %}