{#- A rule at the contribution boundary, stated where it acts (ADR-0104).
Maintenance is the first kind and today the only one: a pin on a node, or on
one of its lines. The block is the one statement of it wherever it shows — who
put it in maintenance, until when and what is left, its note in full, and for an
admin *Edit* and *Clear* — and a pin is edited where its block stands. *Edit* is
the browser's own disclosure, so every editor works without script and pinned
stays a read state (ADR-0014 decision 16); the stylesheet is what makes the
open editor stand in for the note and the buttons.
**On the wall the block is lighter** (ADR-0135 decisions 3 to 5): its mark and
its sentence, the note behind a mark of its own that opens it in a card, an
admin's *Edit* a pencil and *Clear* in the editor, in words. A node's page and
the *Handled* page state it whole. Every block's edge is dashed — nothing else
on the wall has one — and only a rule that paints its node fills its block.
**The kind is data** (decision 8): `data-rule` on the block picks its tint in
the stylesheet, `rule_mark` draws its mark, and a rule an admin set is the one
that carries buttons — a viewer, and one day a rule the configuration declares,
gets the block without them. A second kind is a second value of each and a row
beside this one, never a second component.
`path` and `slug` address the pin as `POST /pins/maintenance` reads them
(`slug` empty for the node's own), and `prefix` keeps an editor's field ids
unique on a page that may carry hundreds of them. Imported `with context`, for the
deployment's default window and its timezone that the fields print.
**A block on the wall or in a branch's head stands in what the refresh swaps**
(decision 7), so the refresh waits while one of these editors is open: what
`poll.js` looks for is an open disclosure around a
`form.maintenance-editor-form`, which is the shape both macros below write. -#}
{% from '_maintenance_fields.html' import maintenance_fields with context %}
{#- The kind's mark: maintenance pauses, as the wall's pin control draws it, a
failure accepted — *seen* — is a ringed check (ADR-0135 decision 2, ADR-0142), and
a configured rule is §, which says where a rule is written rather than what it
does (ADR-0135 decision 1, ADR-0137), drawn as a path to the cues' height. The
bell struck through comes with *silenced*. -#}
{% macro rule_mark(kind) -%}
{%- if kind in ('seen', 'done') -%}
{%- elif kind == 'maintenance' -%}
{%- elif kind == 'aggregation' -%}
{%- endif -%}
{%- endmacro %}
{#- What is handled beneath a closed node, and the index of it (ADR-0135 decisions 6
and 8): a ringed diamond, in `currentColor` as the marks are; decorative, its
words in the tooltip and the accessible name of what carries it. -#}
{% macro handled_mark() -%}
{%- endmacro %}
{#- The marks of a block's own buttons on the wall (ADR-0135 decisions 3 and 4): a
speech bubble that opens the note, a pencil that opens the editor. Decorative;
each button's words are its title and its hidden text. -#}
{% macro note_mark() -%}
{%- endmacro %}
{% macro pencil_mark() -%}
{%- endmacro %}
{#- The marks of a head's own buttons (ADR-0127 decision 3), drawn from
`currentColor` as the rule mark is, so they hold on every surface in every
theme: ↗ for the node's page, the healthy fold's funnel, ▤ for the children
as chips, ‖ for an admin's pin still to be set, the ringed check for what fails
there to be marked seen (ADR-0142), and ⋯ for the node's actions that did not fit
the head's row. Decorative; each button's `aria-label` says
what it does. A page draws the shapes once, `icon_sprite`, outside the grid the
refresh swaps, and each mark refers to its shape — three buttons on every open
head would otherwise carry a kilobyte of paths each in every fragment. -#}
{% macro icon_sprite() -%}
{%- endmacro %}
{% macro icon_mark(kind) -%}
{%- endmacro %}
{#- The page's one editor of a pin still to be set (ADR-0104 decision 3, ADR-0127
decision 3): an admin's ‖ in a head's icons clones it into the node's box, where
the block will stand — `tree.js` fills in the node's path and what the pin would
cover, and opens it — so that no fragment carries an editor, where one in every
head would be some 850 KB in every swap of an admin's tab. It is the pause mark's
disclosure as it was, so the open clone is what `poll.js` waits for and what
`maintenance-edit.js` closes with Cancel and Escape; its summary, which only a
page without script would show, never shows, since without script there is no
clone and ‖ is a link to the node's page. Drawn by `status.html` **outside**
`#status-grid`, once, where the refresh never reaches it, and only for an admin
off the kiosk. A pinned node has no ‖, its block carrying *Edit* and *Clear*.
The sentence names what the pin covers: a node with others beneath it says so,
whether or not the page shows them, which `data-beneath` on its ‖ says from the
unfiltered tree; `next` is the page's own address, where the write comes back. -#}
{% macro pin_editor(next) -%}
Set maintenance
{{ pin_new('node', '', '', '', 'pin-editor', what=('this node' | safe), next=next) }}
{{ pin_record(entry) }}
{%- endif %} {%- if record %}{{ pin_record(entry) }}
{%- endif %} {{ tag }}> {%- endmacro %} {#- Where a configured rule is written and since when it stands (ADR-0137): who set it is its file, in its root, and its history the repository's. -#} {% macro config_record(rule) -%} Configured in{{ rule.file }} since {{ rule.since.isoformat() }}.
{%- endmacro %}
{#- A configured rule, stated where it acts (ADR-0137, ADR-0104 decision 8): its
mark, §, and its sentence — what it makes of its part at `place`, while fewer
than its count fail and how many do, by which rule — its note and where it is
written. Its kind is data as a pin's is: `data-rule="aggregation"`, no fill of
its own, the node's color running through it under the dashed edge (ADR-0135
decision 5), and **no buttons**: a configured rule is changed in the
configuration, the program never writing `config/`, so the block says where.
`place` is `node` — what the node passes up — `lines`, `children`, or
`counted`, how its parent counts it among its children (`parent` names that
node). On the wall (`wall`) the block stands only while its rule changes a
count, its note behind its mark as a pin's is, and the sentence names no node,
the box's head doing so; on a node's page and in *Handled* it stands always,
whole, `this` naming the node, and says *changes nothing now* where its rule
does not act. `others` are the rules written for the same place that the first
one written decides over (ADR-0137 decision 3). In *Handled* (`index`) the
sentence names the part the rule picks by its path, and no one part's count. -#}
{% macro config_block(at, place, path, prefix, wall=false, this='', tag='div',
parent='', others=(), index=false) -%}
{%- set said = rule_said(at.rule, place, failing=none if index else at.failing, this=this, path=at.rule.selector if index else '', parent=parent) -%}
<{{ tag }} class="rule-block rule-block--{{ 'line' if place == 'lines' and not this and not wall else 'node' }}{{ ' rule-block--wall' if wall }}{{ ' rule-block--idle' if not at.changes }}" data-rule="aggregation" data-rule-name="{{ at.rule.name }}">
{{ config_record(at.rule) }}
{%- else %}{{ config_record(at.rule) }}{% if others %} Written for this place too, and decided over by it as the first written: {% for other in others %}{{ other.name }} in {{ other.file }}{{ ', ' if not loop.last }}{% endfor %}.{% endif %}
{{ rule_mark('maintenance') }}Maintenance for {% if what %}{{ what }}{% else %}this {{ scope }}{% if scope == 'line' %} only{% endif %}{% endif %}.{% if covers %} {{ covers }}{% endif %}
{%- if notes %}Or write a note on this {{ scope }}: it is kept with the node's notes and silences nothing.
{%- endif %}{{ rule_mark('seen') }}Mark seen {% if what %}{{ what }}{% elif scope == 'line' %}this line{% else %}this node's own failure{% endif %}. {% if digest %}Each keeps its color, counts as ok above and ends by itself as it changes; a failure that comes later alarms.{% else %}It keeps its color and counts as ok above until it recovers, gets worse, fails anew or is no longer reported.{% endif %}
{%- if parts %}