{#- 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 }} {{ a.requested_by }}{% if a.requested_via == "guard" %} · opened by the guard{% endif %} · requested

    {%- if a.is_open -%}waits for you {%- elif a.status == "refused" -%}refused {%- elif a.status == "expired" -%}expired {% if place != "card" %} {{ a.expired_reason }}{% endif %} {%- 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 }}{% 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.action == "deploy" and a.task_deploy_notes %}

    Deploy notes of the card ({{ "done" if a.task_deploy_done else "not done yet" }}):

    {{ a.task_deploy_notes|markdown }}
    {% endif %} {% if a.decision_text %}

    Your line: {{ a.decision_text }}

    {% endif %} {% if not a.is_open and place == "card" %}

    No button: {{ approval_no_button(a) }}

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