{{ result.issued_at[:10] if result.issued_at else '—' }}
Verification Token
{{ result.token }}
{# aca-int-07 part 2: what was actually demonstrated. Until now this page could
only repeat the label back, because issue_certificate discarded every detail
check_cert_eligibility had computed. This is the snapshot taken at issue time,
not a fresh computation — a certificate is a statement about a moment. #}
{% set ev = result.evidence | default([]) %}
{% if ev %}
{% set gates = ev | selectattr('evidence_type', 'equalto', 'gate') | list %}
{% set missions = ev | selectattr('evidence_type', 'equalto', 'mission') | list %}
{% set steps = ev | selectattr('evidence_type', 'equalto', 'step') | list %}
{% set competencies = ev | selectattr('evidence_type', 'equalto', 'competency') | list %}
{# aca-trn-02: the competency classes come FIRST, above the missions and steps.
Missions and steps say what the learner did; a competency says what that work
is evidence OF, in the platform's shared ontology vocabulary — which is the
part a reader outside the Academy can act on. Recording the row and then
filtering it out of the one page a verifier actually reads would leave the
training record real but unciteable. #}
{% if competencies %}
{{ s.label }}
— {{ s.detail }}
{% if s.score is not none %}
, scored {{ s.score }}
{% endif %}
{% if s.demonstrated_at %}
{{ s.demonstrated_at[:10] }}
{% endif %}
{% endfor %}
{% endif %}
{% else %}
{# Say so rather than rendering an empty section that reads as "nothing required".
Certificates issued before migration 317 carry no evidence and cannot be given
any honestly — reconstructing it after the fact is the defect, not the fix. #}
Evidence
This certificate was issued before evidence was recorded, so the work behind
it cannot be shown here.