{# The tree's filter bar and body (#302): the `/ui/tree` page and the focus page's Tree view (#316) render it alike. `tree_action`: where the bar submits (`/ui/tree`, `/ui/focus`); `in_focus`: the focus page's view, where `focus` and `live` are fixed on and the scope pickers are left out (`tkt tree --focus` names its own scope). #} {% from "_pickers.html" import picker %} {% from "_when.html" import when, sort_field %} {% from "_where.html" import live_line, where, server_live_note with context %} {% macro pill(s) %}{{ s | replace('_', ' ') }}{% endmacro %} {% macro row(e) %} {% set ac = e.acceptanceCriteria %}
{% if e.missing %} {{ e.id }}not found {% else %} {{ type_icon(e.type) }}{{ e.id }} {{ e.title }} {{ pill(e.status) }} {% if e.release %}✓ {{ e.release }}{% endif %} {% if e.priority and e.priority != 'none' %}{{ e.priority }}{% endif %} {% if ac and ac.total %}{{ ac.done }}/{{ ac.total }}{% endif %} {% if e.value %}◆ {{ e.value }}{% endif %} {% if e.points and e.points.total %}{{ e.points.done | default(0) }}/{{ e.points.total }} pts{% elif e.estimate is defined and e.estimate is not none %}{{ e.estimate }} pts{% endif %} {% if e.blocked_by %}⛔ {% for x in e.blocked_by %}{{ x }}{{ ' (outside)' if x in data.outside }}{{ ', ' if not loop.last }}{% endfor %}{% endif %} {% if e.blocks %}blocks {% for x in e.blocks %}{{ x }}{{ ', ' if not loop.last }}{% endfor %}{% endif %} {{ live_line(e.live) }} {% if e.updatedAt %}{{ when(e.updatedAt, 'updated') }}{% endif %} {% endif %}
{{ where(e.id) }} {% endmacro %} {% macro node(e) %} {% if e.children %}
{{ row(e) }} {% if e.status_counts %}
{% for s, n in e.status_counts | dictsort(by='value', reverse=true) %}{{ n }} {{ s | replace('_', ' ') }}{% endfor %} {% if e.hidden_children %}{% endif %}
{% endif %}
{% for c in e.children %}{{ node(c) }}{% endfor %}
{% else %}
{{ row(e) }}
{% endif %} {% endmacro %} {% macro one(name) %}{{ (options.get(name) or [''])[-1] }}{% endmacro %}
{% if in_focus %}{% endif %} {% for v in options.get('target') or [] %}{% endfor %} {% for name in ('status', 'type', 'priority') %} {% endfor %} {% for name in (('label',) if in_focus else ('label', 'milestone', 'release')) %} {% endfor %} {% if in_focus %} live focus {% else %} {% endif %} {{ sort_field(sort) }} {% if options is filtered or sort %}Clear filters{% endif %} Each filter is a tkt tree option, and the URL keeps it.
{% if options.get('live') and not in_focus %}{{ server_live_note() }}{% endif %} {% if error %} {% elif data.focus is none and (in_focus or options.get('focus')) %}

No focus. Set one: tkt focus set <milestone|epic> or tkt focus release <id>.

{% else %} {% if data.truncated %}

Truncated: more tickets match than the node cap shows.

{% endif %} {% if data.outside %}

⛔ open blockers outside the scope: {% for x in data.outside %}{{ x }}{{ ', ' if not loop.last }}{% endfor %}

{% endif %}
{% for e in data.roots %}{{ node(e) }}{% else %}

No tickets match.

{% endfor %}
{% endif %}