{% from '_rule_block.html' import pin_block, rule_mark, config_block with context %}
{% from '_pin_sections.html' import suspended_pins, suspended_sentence with context %}
{% set page_title = 'Handled' %}
{% include '_header.html' %}
{#- *Handled*, the index of every rule that stands (ADR-0135 decision 8), its
sections the jobs — *In maintenance*, *Accepted* (ADR-0142) and *By a rule*
(ADR-0137). In maintenance,
**every pin** — a node's own, or one of its reasons' — with what it holds,
how long is left, why, and who is behind it, read from the whole snapshot
so it is depth- and filter-independent, the nodes whose pins stand longest
first, so that the old ones are where the eye starts. Viewer-visible and
bookmarkable; the band's pill and its popover's "+N more" link here, and
`/maintenance` answers with it. A plain page (the check.html / events.html
pattern), not polled — so an open editor has nothing to wait for.
This page is what makes the popover's one-row-per-node summary safe: it is
where *"what is in maintenance right now?"* is answered completely, so the
capped surface is free to fold.
**The same blocks as a node's own page** (ADR-0104 decision 6,
`_rule_block.html`), grouped under each node's path: the node's own pin
first, then its lines' in the check's order — which is information
(severity, API order) that the order they were pinned in is not. Each is
read here and, by an admin, changed here: *Edit* opens in the block, and a
save or a clear comes back to this page with its node named —
`?node= {{ pins | length }} {{ 'pin' if pins | length == 1 else 'pins' }} on {{ nodes }} {{ 'node' if nodes == 1 else 'nodes' }}, the longest standing first. {{ suspended_sentence(group) }} Nothing is handled: no node or line is in maintenance, seen or held by a rule. {{ marked }} seen on {{ accepted | length }} {{ 'node' if accepted | length == 1 else 'nodes' }}, the longest standing first. {{ by_rule | length }} {{ 'rule' if by_rule | length == 1 else 'rules' }} configured, the longest standing first.
{%- if row.acting %}It changes the count of {{ row.parts }} {{ 'part' if row.parts == 1 else 'parts' }} now:
{% for path, lines in row.acting %}{{ path }}{% if lines %} — {{ lines }} {{ 'line' if lines == 1 else 'lines' }}{% endif %}{{ ', ' if not loop.last else '.' }}{% endfor %}
{%- elif not row.picked and not row.folded %}It picks nothing now.
{%- else %}
{%- if row.picked %}It picks {{ row.picked }} {{ 'place' if row.picked == 1 else 'places' }} now and changes no count there{% if row.over %}: {% for path, name in row.over %}at {{ path }} the rule {{ name }}, written before it, decides{{ '; ' if not loop.last }}{% endfor %}{% endif %}.{% else %}It picks nothing now.{% endif %}
{%- if row.folded %} With case folded it would pick {% for path in row.folded %}{{ path }}{{ ', ' if not loop.last }}{% endfor %}.{% endif %}
{%- endif %}Handled
{% if pins %}
{%- set nodes = groups | length %}
{{ rule_mark('maintenance') }}In maintenance
{% if suspended %}{{ path }}{% else %}{{ path }}{% endif %}{% set shown = group[0] | node_title %}{% if shown %} {{ shown | markdown_inline(node=path) }}{% endif %}
{%- if suspended %}
{{ rule_mark('seen') }}Accepted
{{ path }}{% set shown = group[0] | node_title %}{% if shown %} {{ shown | markdown_inline(node=path) }}{% endif %}
{{ rule_mark('aggregation') }}By a rule
{{ row.rule.name }}