{#- Backlog cards, refetched on backlog.* events. Expects: backlog_project (None: all projects), open_items, history, show_history, filter_qs. -#} {%- set base = "/p/" ~ backlog_project.slug ~ "/backlog" if backlog_project else "/backlog" %} {%- set view_qs = filter_qs ~ ("&history=1" if filter_qs and show_history else ("history=1" if show_history else "")) %} {%- set back = base ~ ("?" ~ view_qs if view_qs else "") %} {%- macro item(b, actions) -%}
#{{ b.id }}

{{ b.title }}

{% if not backlog_project %}{{ b.project_slug }}{% endif %} {% if b.area %}{{ b.area }}{% endif %} {% if b.priority %}priority {{ b.priority }}{% endif %} {% if b.assignee %}for {{ b.assignee }}{% endif %} {{ b.origin }} {%- if b.origin_task_key %} · {{ b.origin_task_key }}{% if b.origin_task_stage %} {{ label(b.origin_task_stage) }}{% endif %}{% endif %} {%- if b.origin_session_name %} · {{ b.origin_session_name }}{% endif %} {%- if b.intake_message_id %} · message #{{ b.intake_message_id }}{% endif -%} {{ b.status }} {%- if b.task_key %} {{ b.task_key }}{% endif %} {%- if b.status in ("declined", "done") and b.decline_reason %} {{ b.decline_reason }}{% endif %} {%- if b.status == "done" and b.link %} {{ b.link }}{% endif %}
{#- An intake item's body is external text: plain text, never markdown. #} {% if b.body_md %}
what{% if b.origin == "intake" %}

{{ b.body_md }}

{% else %}
{{ b.body_md|markdown }}
{% endif %}
{% endif %} {% if actions %}
{% if b.status != "later" %}
{% endif %}
Done
Not doing
{% endif %}
{%- endmacro %}
{% if open_items %}
{% for b in open_items %}{{ item(b, True) }}{% endfor %}
{% else %}

Nothing open on the backlog.

{% endif %} {% if history %}

Planned, done and declined {{ history|length }}

{% for b in history %}{{ item(b, False) }}{% endfor %}
{% endif %}