{# The completion report (docs/completion-report.md); `r` is data.report(). #} {% macro deliverables(r) %} {% if r.deliverables %} {% endif %} {% endmacro %} {% macro outcome(r) %}{% if r.outcome_html is not none %}{{ r.outcome_html|safe }}{% else %}{{ r.outcome }}{% endif %}{% endmacro %} {% macro text(s) %}{% if s.html is not none %}
{{ s.html|safe }}
{% else %}
{{ s.text }}
{% endif %}{% endmacro %} {% macro body(e, r, top=True) %} {% for s in r.sections if s.name == "Outcome" and s.text and s.text != r.outcome %}
{{ text(s) }}
{% endfor %} {% set listed = namespace(done=False) %} {% for s in r.sections if s.name != "Outcome" %} {% if s.name == "Deliverables" %}{% set listed.done = True %} {% if r.deliverables or s.text %}

Deliverables

{{ deliverables(r) }}{% if s.text %}{{ text(s) }}{% endif %}{% endif %} {% else %}

{{ s.name }}

{% if s.text %}{{ text(s) }}{% else %}

none

{% endif %} {% endif %} {% endfor %} {% if not listed.done and r.deliverables %}

Deliverables

{{ deliverables(r) }}{% endif %} {% if r.children %}

Children

{% for c in r.children %}
{{ c.name or c.short }} {% if c.state == "NEEDS_INPUT" %}NEEDS_INPUT{% else %}{{ c.state or "?" }}{% endif %} {% if c.report %}{{ outcome(c.report) }}{% elif c.state in ("COMPLETED", "FAILED") %}finished without a report{% else %}no report yet{% endif %} {% if c.report %}{{ body(e, c.report, False) }}{% endif %}
{% endfor %} {% endif %} {% endmacro %} {% macro panel(e, p, steps_href="#steps") %} {% if p.report %}
{{ "Finished" if p.meta.state == "COMPLETED" else "Failed" }}{% if p.meta.updated %} · {{ p.meta.updated }}{% endif %} · {{ p.steps|length }} step{{ "s" if p.steps|length != 1 }}

{{ outcome(p.report) }}

{{ body(e, p.report) }}
{% elif p.meta.state in ("COMPLETED", "FAILED") %}
{{ "Finished" if p.meta.state == "COMPLETED" else "Failed" }} without a completion report (it predates them). Last summary:
{% if p.summary_html is not none %}
{{ p.summary_html|safe }}
{% else %}
{{ p.summary }}
{% endif %}
{% endif %} {% endmacro %}