{% extends "base.html" %}
{# The packet's plan as a tree, and the versions of it (docs/plan-tree.md). #}
{% set q = e.name|urlencode %}
{% set base = "/p/" ~ q ~ "/" ~ pl.wpid %}
{% macro href(v=None, changes=None, open=None, detail=pl.detail) -%}
?{{ ("v=" ~ v|urlencode ~ "&") if v }}{{ "changes=1&" if changes }}{{ "detail=1&" if detail }}{{ ("open=" ~ open) if open }}
{%- endmacro %}
{% block title %}plan · {{ pl.short }} · {{ e.name }}{% endblock %}
{% block crumbs %}/ {{ e.name }} / {{ pl.short }} / plan{% endblock %}
{% block head %}
{% endblock %}
{% macro row(n) -%}
{% if n.kind == "group" %}{{ n.text|inline }}{% else %}{{ MARK.get(n.state, "○") }}{% if n.id %}{{ n.id }}{% endif %}{{ (n.lead or n.text)|inline }}{% if pl.detail and n.tail %} — {{ n.tail|inline }}{% endif %}{% endif %}
{%- if n.change == "new" %}new{% elif n.change == "state" %}was {{ n.was }}{% elif n.change == "edited" %}edited{% endif %}
{%- set d, t = n.count %}{% if t %}{{ d }}/{{ t }}{% endif %}
{%- if n.steps %}step{{ "s" if n.steps|length > 1 }} {% for s in n.steps %}{{ s.n }}{% if s.outcome == "failed" %}✗{% endif %}{{ " " if not loop.last }}{% endfor %}{% endif %}
{%- if n.cost %}{{ n.cost|money }}{% endif %}
{%- if n.id and n.id in pl.notes %}notes{% endif %}
{%- if pl.detail and n.date %}{{ n.date }}{% endif %}
{%- if n.said %}{{ n.said|truncate(160) }}{% endif %}
{%- endmacro %}
{% macro node(n) -%}
{% if not pl.changes or n.change or n.changed %}
{% set cls = ("pt-" ~ n.kind ~ " " ~ (n.state or "") ~ (" cur" if n.current else ""))|trim %}
{% if n.children or (pl.detail and n.details) or n.notes %}
{{ row(n) }}
{% for d in n.details %}
{% endif %}
{% for t in n.notes %}
No outline yet: a packet's plan is state/outline.md, a Markdown checklist (- [ ] 1 ...).
Nothing changed in this version{% if pl.gone %} but removals{% endif %}.
{% endif %}{{ c.short }} {{ c.state }}{% if c.done[1] %}{{ c.done[0] }}/{{ c.done[1] }}{% endif %}No outline.
{% endif %}