{#- #429: the entity page header: the open review, the reader header (design §3.8) and the completeness checklist of one read, rendered from its `completeness` payload only (#402), as `tkt get --json` carries it. The UI computes nothing: the numbers, the details and the commands are the payload's. Owner, 2026-11-22: the checklist opens in place, closed on load, with the payload's item keys; a superseded item gets an accent banner. -#} {% macro ref(r) %}{% set u = ref_url(r) %}{% if u %}{{ r }}{% else %}{{ r }}{% endif %}{% endmacro %} {% macro entity_header(c) %} {% if c %} {% set head = c.header or {} %} {% set items = c['items'] or [] %} {% set changed = head.changed or [] %} {% set review = items | selectattr('item', 'equalto', 'openReviews') | rejectattr('met') | first %} {% set first = items | rejectattr('met') | first %}
{% if head.replacedBy %}
↪ Superseded by {{ ref(head.replacedBy) }}: continue there.
{% endif %} {% if review %} {% set n = changed | length %}
⟳ Review needed {{ n }} source{{ 's' if n != 1 }} changed since the last review: {% for r in changed %}{{ ref(r) }}{{ ', ' if not loop.last }}{% endfor %} {% if review.command %}→ {{ review.command }} {% endif %}
{% endif %} {% if head.buildsOn or head.unbound %}

{%- if head.buildsOn %}Builds on {{ head.buildsOn }} item{{ 's' if head.buildsOn != 1 }}, {% if changed %}{{ changed | length }} changed since the last review{% else %}none changed since the last review{% endif %}{% endif %} {%- if head.unbound %} Unbound: {{ head.unbound }} mention{{ 's' if head.unbound != 1 }}{% endif -%}

{% endif %} {% if c.scored %}
Complete: {{ c.percent }} % ({{ c.met }} of {{ c.total }})
    {% for i in items %}
  • {{ 'met' if i.met else 'not met' }} {{ i.item }} {{ '%g' | format(i.points) }}/{{ i.weight }} {{ i.detail }}{% if i.command %} → {{ i.command }}{% endif %}
  • {% endfor %}
{% if first %}

first unmet: {{ first.item }}{% if first.command %} → {{ first.command }}{% endif %}

{% endif %} {% else %}

Complete: not scored ({{ c.reason }})

{% endif %}
{% endif %} {% endmacro %}