{#- One approval request, on the card (place "card") and in the Inbox (place "inbox", with its card). The owner approves or refuses it with an optional line; an approved one shows when and by which call it was used. -#} {%- macro approval_item(a, place) -%}
  • {% if place == "inbox" %}{{ a.task_key }} {{ a.task_title }}{% endif %} #{{ a.id }} {{ a.action }} {% if a.run_id %}run {{ a.run_id }}{% else %}desktop session{% endif %} · {{ a.requested_by }}{% if a.requested_via == "guard" %} · opened by the guard{% elif a.requested_via == "denial" %} · from a permission denial{% endif %} · requested

    {%- if a.is_open -%}waits for you {%- elif a.status == "refused" -%}refused {%- elif a.status == "expired" -%}expired {{ a.expired_reason }} {%- elif a.status == "used" -%}approved, used by {{ a.used_by }} {%- elif a.reserved -%}approved, held for a running call {{ a.reserved_call }} {%- else -%}approved , not used yet {%- endif -%} {%- if a.decision %} {% if a.delivered_at %}delivered {% elif a.comment_id %}waits as owner comment #{{ a.comment_id }}{% elif a.turn_seq and a.turn_outcome in ("cancelled", "failed_to_start", "lost") %}not delivered: turn {{ a.turn_seq }} {{ a.turn_outcome|replace("_", " ") }}; it goes with the run's next turn{% elif a.turn_seq %}waits as turn {{ a.turn_seq }}{% else %}not delivered yet{% endif %}{% endif %}

    {{ a.what }}

    {{ a.summary }}

    {% if a.rollback %}

    Rollback: {{ a.rollback }}

    {% elif a.action == "deploy" %}

    No rollback command given: a deploy is approved only with one. Refuse it, or wait for the agent to ask again with approval_request.

    {% endif %} {% if a.decision_text %}

    Your line: {{ a.decision_text }}

    {% endif %} {% if a.is_open %}
    {% endif %}
  • {%- endmacro %}