{#- 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
silenced it, 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.
**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 /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. -#}
{% macro rule_mark(kind) -%}
{%- if kind == 'maintenance' -%}
{%- endif -%}
{%- 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, 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 %} {{ tag }}> {%- endmacro %} {#- The pins set on nodes above this one, each a block where it acts: outermost first, as the path reads, and without buttons (ADR-0104 decision 2). `above` is the view's list of (path, pin); `tag` is `li` where the blocks are rows of a node's rule list, and `bare` is a card's sentence, whose head names the node already. -#} {% macro pins_above_stated(above, prefix, tag='div', bare=false) -%} {%- for source, entry in above %} {{ pin_block(entry, 'node', source | url_branch, '', prefix ~ loop.index, false, tag=tag, bare=bare, source=source) }} {%- endfor %} {%- endmacro %} {#- The editor of a pin still to be set, standing where its block will (decision 3). Its first sentence says what the pin covers — `covers` is the caller's, which knows the node — and the form claims nothing is pinned: an empty token, and an empty expiry, which is the configured default. On a node's own page *this node* is the page's node. A card on the wall is one of many, so there the sentence names what it covers outright (`what`): *hemulen and everything beneath it*. `next` is the page a set comes back to, where that is not the node's own. -#} {% macro pin_new(scope, covers, path, slug, prefix, what='', next='') -%}{{ rule_mark('maintenance') }}Maintenance for {% if what %}{{ what }}{% else %}this {{ scope }}{% if scope == 'line' %} only{% endif %}{% endif %}.{% if covers %} {{ covers }}{% endif %}