{#- 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 the button** (ADR-0147 decision 7, `wall_block`): its mark and its sentence, one link to its node's *Notes* tab at it, where its note, *Edit* and *Clear* stand in the drawer — and only while *◇ details* is on (decision 6). 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 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. Each such form opens on a line that says the pause where its cause is, *updates paused*, which the stylesheet shows while the form's editor stands open in what `poll.js` swaps — the stamp keeps its width (ADR-0147 decision 4). -#} {% from '_maintenance_fields.html' import maintenance_fields, schedule_fields, silence_fields, done_fields with context %} {#- The kind's mark: maintenance pauses, ‖, 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. A failure silenced is a bell struck through (ADR-0143 decision 2, ADR-0144). -#} {% macro rule_mark(kind) -%} {%- if kind == 'silenced' -%} {%- elif kind in ('seen', 'done') -%} {%- elif kind == 'maintenance' -%} {%- elif kind == 'aggregation' -%} {%- endif -%} {%- endmacro %} {#- What is handled beneath a closed node, the index of it (ADR-0135 decisions 6 and 8) and the kiosk's door (ADR-0147 decision 1): 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 %} {#- A note's mark, a speech bubble: the *Notes* tab's own kind, *Note*, in its form's choice. Decorative; the choice's word says it. -#} {% macro note_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 the node's door to its *Notes* tab (ADR-0147), 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 %} {#- **One door, ◇** (ADR-0147 decisions 1 and 2): a link to a node's *Notes* tab, where every kind is set and a standing pin changed, for every reader — whoever may set nothing (`may` false) reading what it opens, its words saying so. On a head it is lit with the number of parts handled at and beneath the node, `door` (`tree.DoorCount`), whose words are its tooltip and its accessible name, and plain where nothing is; the tab opens at its top. A line's door, `slug`, stands in the line's seat for whoever may set something on it, opens the tab's form on that line and is never lit: where something handles the line, its mark is its door (`line_mark`). `cls` is the control's look, a head's square or a line's seat. A mark that is a door says so with `data-door` (`line_mark`, `head_marks`), ◇ with `data-control="door"` — and a lit ◇ that stands in the state cluster with the marks, as it does under the looks whose toolbar shows only under the pointer (`state_door`), with both (`mark`). -#} {% macro door_link(path, name, door=none, slug='', cls='node-icon', may=false, mark=false) -%} {%- set lit = door.count if door else 0 -%} {%- set words = door.words if door else '' -%} {%- if slug -%} {%- set href = url_for('notes', path=path | url_branch, reason=slug) ~ '#add-note' -%} {%- set title = 'Handle this line' -%} {%- set label = 'handle this line of ' ~ name -%} {%- else -%} {%- set href = url_for('notes', path=path | url_branch) -%} {%- set title = ('Handle it' if may else 'Notes') ~ (' — ' ~ words if words else '') -%} {%- set label = ('handle ' if may else 'the notes of ') ~ name ~ (' — ' ~ words if words else '') -%} {%- endif -%} {{ icon_mark('door') }}{% if lit %}{{ lit }}{% endif %} {%- endmacro %} {#- The door on the kiosk, which draws no controls (ADR-0147 decision 1): ◇ lit with its number where something is handled at or beneath the node, a mark and no button, its words its tooltip and its hidden text; nothing where nothing is. -#} {% macro door_mark(door=none) -%} {%- if door and door.count -%} {{ handled_mark() }}{{ door.count }} — {{ door.words }} {%- endif -%} {%- endmacro %} {#- The line at the top of an editor's form that says the page waits for it, *updates paused* (ADR-0147 decision 4): the stylesheet shows it while the editor stands open in what `poll.js` swaps, in the frame it opens in, and never on a page that nothing refreshes. -#} {% macro paused_line() -%}

updates paused

{%- endmacro %} {#- An instant in the block's words, each word of it kept whole: the date and the time of day, or whatever the deployment's `time_format` writes between spaces. A block's sentence wraps where it must — a card on the wall is narrow — and a hyphen is a place for a line to end: *until 2026-10-*, and the day on the next line with the time. Between the words a line may end, as anywhere in a sentence, so nothing here is wider than what it stands in. -#} {% macro instant(value) -%} {%- for word in (value | localtime).split() -%} {{ word }}{% if not loop.last %} {% endif %} {%- endfor -%} {%- endmacro %} {#- Who pinned it, and who changed it last where that is somebody else's write: the block's sentence names only the last. An acknowledgment was marked, in its kind's word (ADR-0142), and a silence silenced (ADR-0144). -#} {% macro pin_record(entry) -%} {% if entry.kind == 'maintenance' %}Pinned{% elif entry.kind == 'silenced' %}Silenced{% else %}Marked {{ entry.kind }}{% endif %} by {{ entry.created_by or 'unknown' }} {{ instant(entry.created_at) }}. {%- if entry.set_at != entry.created_at %} Last changed by {{ entry.set_by or 'unknown' }} {{ instant(entry.set_at) }}.{% endif %} {%- endmacro %} {#- A pin, stated. `scope` is what it holds — `node` or `line` — and `also` marks a line's pin under its node's: the line stays quiet when the node's pin ends, which is the one thing the block has to add there. `tag` is `li` where the block is a row of a node's rule list. Where the block stands says what it covers, so what its sentence opens with is the place's to say (`subject`): on a node's own page it is *This node* or *This line*, and on *Handled*, where the block stands under a path and away from its line, *The whole node* or the line itself. There `record` puts the pin's authors under the note for everyone — the page has room for the whole reading, and a viewer has no editor to find it in — `next` brings a saved edit back to the page, and `of` names the node in the buttons' names: a page of many blocks is a page of many Edits. A card on the wall is the third place: its head names the node already, so the sentence opens with what was done to it (`bare`) — *In maintenance by* — and says nothing twice. `wall` is every block the wall draws, a box's beside a card's: the button that opens the drawer at it (`wall_block`), its note and its buttons the drawer's. The stored placeholder `maintenance` is the absence of a note, not a note somebody wrote, so it is neither shown nor offered as the source to edit; a blank note on an edit keeps the stored text (ADR-0014 decision 15), so leaving it blank writes the placeholder back. `source` is the node a pin **above** this one stands on, which holds it with everything else beneath that node (ADR-0041): the block is stated where it acts as well as where it was set — *This node is in maintenance from /nexus/qnap* — linked to that node's page, and `pins_above_stated` states it without buttons, since a pin is edited where it stands (ADR-0104 decision 2). **An acknowledgment is the same block in its kind's words** (ADR-0142 decision 6, ADR-0144, ADR-0104 decision 8): `data-rule` its kind, which takes no fill, its mark the ringed check or the bell struck through, its sentence `ack_said`, its record *Marked seen by* or *Silenced by*, and its editor the ringed check's, `ack_forms`, where the kind may change — to *done* as well, where the part is a line whose failure is an event that fails now, its occurrence `event` (ADR-0146). Its note's mark is keyed by its kind beside its part, so that a part's maintenance and its acknowledgment each open their own. `at` is the block a *Notes* tab was asked at, `?at=` its kind on the line `?reason=` names (ADR-0147 decision 3): a mark's door lands there, so the block carries the page's one anchor `at`, and its editor stands open for whoever may change it. `ran` is what has run of a series, which its note counts and a *Notes* tab hands in (`notes_tab.Ran`, ADR-0150): its schedule's row ends in it — *· 3 windows ran, the last closed by hand, by pan*. -#} {% macro pin_block(entry, scope, path, slug, prefix, editable, also=false, tag='div', subject='', record=false, next='', of='', bare=false, source='', wall=false, fails=true, event='', at=false, ran=none) -%} {%- if wall -%} {{ wall_block(entry, scope, path, slug, bare=bare, source=source) }} {%- else -%} {%- set kept_kind = entry.kind == 'maintenance' -%} {%- set series = kept_kind and entry.schedule is not none and not entry.schedule.is_one_off -%} {%- set opened = entry | series_open if series else none -%} {%- set ends = entry | ends -%} {%- set note = entry.note if entry.note != 'maintenance' or not kept_kind else '' -%} {%- set named %} this {{ scope }}'s {{ 'schedule' if series else entry.kind }}{% if of %}, {{ of }}{% endif %}{% endset -%} {%- set window_named %} this {{ scope }}'s window{% if of %}, {{ of }}{% endif %}{% endset -%} <{{ tag }}{% if at %} id="at"{% endif %} class="rule-block rule-block--{{ scope }}{{ ' rule-block--series' if series }}{{ ' is-at' if at }}" data-rule="{{ entry.kind }}">
{{ rule_mark(entry.kind) }}{% if not kept_kind %}{{ ack_said(entry, scope, subject, bare, path) }}{% else %}{% if bare %}In maintenance{% else %}{% if subject %}{{ subject }}{% else %}This {{ scope }}{% endif %} is {% if also %}also in maintenance on its own{% else %}in maintenance{% endif %}{% endif %}{% if source %} from {{ source }}{% endif %} {{ window_by(entry, opened, ends) }}{% endif %} {%- if editable and series and opened %} {{ extend_form(entry, opened, path, slug, prefix, window_named, next) }} {{ end_form(entry, opened, path, slug, prefix, window_named, next) }} {%- elif editable and not series %} {%- if kept_kind %} {{ entry_edit(entry, path, slug, prefix, named, next, prefix ~ '-what', at) }} {%- else %}
Edit{{ named }} {{ ack_forms(scope, path, slug, prefix, entry=entry, next=next, fails=fails, event=event) }}
{%- endif %}
{{- panel_field() }} {%- if slug %} {%- endif %} {%- if next %} {%- endif %}
{%- endif %}
{%- if series %} {#- the schedule, its second row (#35's note, decision 5): its sentence and the next start after this window, or *its last window*, with *Edit*, which shapes the windows to come, and *Clear*, which asks -#}
{{ entry | sentence }}{% if opened and opened.next %} · next {{ instant(opened.next.start) }}{% elif opened and opened.last %} · its last window{% endif %}{% if opened and opened.shut %} · {{ opened.shut | shut_said }}{% endif %}{{ windows_ran(ran) }} {%- if editable %} {{ entry_edit(entry, path, slug, prefix, named, next, prefix ~ '-schedule', at) }} {{ clear_asking(entry, path, slug, prefix, named, next, 'this one and those to come', prefix ~ '-schedule') }} {%- endif %}
{%- endif %} {%- if note %}
{{ note | markdown(node=path) }}
{%- endif %} {%- if record %}

{{ pin_record(entry) }}

{%- endif %} {%- endif -%} {%- endmacro %} {#- What has run of a series that stands, at the end of its row (ADR-0150): how many of its windows closed, and how the last closed — *· 3 windows ran, the last closed by hand, by pan* — where a *Notes* tab hands it in (`notes_tab.Ran`). -#} {% macro windows_ran(ran) -%} {%- if ran %} · {{ ran.windows }} ran, the last closed{% if ran.how %} {{ ran.how }}{% endif %}{% if ran.by %}, by {{ ran.by }}{% endif %}{% endif -%} {%- endmacro %} {#- Who has a maintenance window open, until when, and what is left (ADR-0104 decision 1): the pin's last writer, or for a series the one who set it — whose schedule the window is — and, where the window open was extended, who extended it (#35's note, decision 5): *by anna until 2026-11-01 07:00, extended by lex · 1h 20m left*. The time left is the window's alone; the schedule's end stands in its sentence and never counts down. -#} {% macro window_by(entry, opened, ends) -%} {%- set series = opened is not none or (entry.schedule is not none and not entry.schedule.is_one_off) -%} by {{ (entry.created_by if series else entry.set_by) or 'an admin' }} until {{ instant(ends) }}{% if opened is not none and opened.extended_by %}, extended by {{ opened.extended_by }}{% endif %} · {{ ends | time_left }} {%- endmacro %} {#- A maintenance entry's editor in its block (ADR-0104 decision 4; ADR-0150, landing 4): the browser's own disclosure, *Edit*, holding the entry's editor with every field filled (`schedule_fields`, `app._editor_of`) — a one-off's, a series', and one planned — and *Save changes*. A series' shapes the windows to come: the window open now keeps its end, which only *Extend* and *End now* change. `described` is the row it stands in, the block's sentence or its schedule's. -#} {% macro entry_edit(entry, path, slug, prefix, named, next, described, at=false) -%}
Edit{{ named }}
{{ paused_line() }}

{{ pin_record(entry) }}

{{- panel_field() }} {%- if slug %} {%- endif %} {%- if next %} {%- endif %} {{ schedule_fields(editor_of(entry), prefix, maintenance_default, maintenance_timezone, true) }}
{%- endmacro %} {#- *Extend*, on a series' first row (#35's note, decision 5): the browser's own disclosure, holding its presets — 30 minutes and 1, 2 and 4 hours, counted from the window's end — as buttons, an *Until* read as the end field is, from now, and the optional words why, which the Notes history keeps. It never shortens: an *Until* before the window's end is refused, naming *End now*. The window is named by its start, so that one that closed before the form arrived is refused rather than reopened. The form's first button is a hidden one that reads *Until*, so that Enter in a field does not press a preset. -#} {% macro extend_form(entry, opened, path, slug, prefix, window_named, next) -%}
Extend{{ window_named }}
{{ paused_line() }} {{- panel_field() }} {%- if slug %} {%- endif %} {%- if next %} {%- endif %}

By, from its end at {{ instant(opened.window.end) }}: {%- for seconds, word in ((1800, '30 minutes'), (3600, '1 hour'), (7200, '2 hours'), (14400, '4 hours')) %} {%- endfor %}

Read as the end field is, from now, and later than this window's end. To end it sooner, use End now.
Kept in the Notes, beside the schedule's own.
{%- endmacro %} {#- *End now*, on a series' first row (#35's note, decisions 3 and 5): the browser's own disclosure, holding the optional words why and *End this window*. It closes the window open now, *window closed · by hand*, the schedule's windows to come standing; on its schedule's last window it is the entry's end, *maintenance ended · by hand*, which the form says. -#} {% macro end_form(entry, opened, path, slug, prefix, window_named, next) -%}
End now{{ window_named }}
{{ paused_line() }} {{- panel_field() }} {%- if slug %} {%- endif %} {%- if next %} {%- endif %}

{% if opened.last %}It is its schedule's last window: ending it ends the schedule.{% else %}It ends this window now; the schedule's windows to come stay.{% endif %}

{%- endmacro %} {#- **A series' Clear asks first** (ADR-0150, decision 5 of #35's note): it reaches into the windows to come, which only the schedule's editor puts back, so it is the browser's own disclosure — *This ends every window of the schedule*, `which` the windows it ends — with *Clear the schedule* and *Keep it*, which closes it with script, as the summary does without. A one-off's Clear asks nothing: its one window is all it has. `described` is the row it stands in. -#} {% macro clear_asking(entry, path, slug, prefix, named, next, which, described='') -%}
Clear{{ named }}
{{ paused_line() }} {{- panel_field() }}

This ends every window of the schedule, {{ which }}.

{%- if slug %} {%- endif %} {%- if next %} {%- endif %}
{%- endmacro %} {#- **A maintenance entry planned** (ADR-0150): one that stands and holds nothing now — a window set ahead, or a series between two of its windows — drawn without the tint, since it holds nothing, under *Planned* wherever it is listed, and never among what stands. Its sentence is the entry's one (`sentence`), then when it starts: a one-off's *· starts in 6d*, after its *until …*, and a series' *· next … · in 6d*, whose countdown follows the start it names. Where no window is to open, or its windows stop from a day, its holiday list's words say why (`planned_why`), and where its list cannot be read at all, the words lead to the instance's line that says so. Its *Edit* is the entry's editor, every field filled (`entry_edit`): a one-off's *Starts* and end each kept exactly while unchanged, and a series' its rule, *Until*, *Not on* and its zone (ADR-0150, landing 4). A one-off's *Clear* asks nothing, and a series' asks (`clear_asking`). `subject` names the part where the block stands away from it; `at` is the block a *Notes* tab was asked at — a planned line's door, or the answer to a set that planned it — which takes the focus with its editor closed, so that its sentence is read at once with *Edit* and *Clear* beside it. `ran` is what has run of a series between two of its windows, which a *Notes* tab hands in, at the end of its sentence (`windows_ran`). -#} {% macro planned_block(planned, scope, path, slug, prefix, editable, tag='div', subject='', record=false, next='', of='', at=false, ran=none) -%} {%- set entry = planned.pin -%} {%- set once = entry.schedule.is_one_off -%} {%- set upcoming = planned.next -%} {%- set why = planned | planned_why -%} {%- set note = entry.note if entry.note != 'maintenance' else '' -%} {%- set named %} this {{ scope }}'s {{ 'window' if once else 'schedule' }}{% if of %}, {{ of }}{% endif %}{% endset -%} <{{ tag }}{% if at %} id="at" tabindex="-1" autofocus{% endif %} class="rule-block rule-block--{{ scope }} rule-block--planned{{ ' is-at' if at }}" data-rule="maintenance" data-planned>
{{ rule_mark('maintenance') }}{% if subject %}{{ subject }} · {% endif %}{{ entry | sentence }}{% if upcoming %} {% if once %}· starts in {{ upcoming.start | starts_in }}{% else %}· next {{ instant(upcoming.start) }} · in {{ upcoming.start | starts_in }}{% endif %}{% endif %}{% if why %} · {% if planned.shut and planned.shut.why_not %}{{ why }}{% else %}{{ why }}{% endif %}{% endif %}{{ windows_ran(ran) }} {%- if editable %} {{ entry_edit(entry, path, slug, prefix, named, next, prefix ~ '-what') }} {%- endif %} {%- if editable and once %}
{{- panel_field() }} {%- if slug %} {%- endif %} {%- if next %} {%- endif %}
{%- elif editable %} {{ clear_asking(entry, path, slug, prefix, named, next, 'those to come') }} {%- endif %}
{%- if note %}
{{ note | markdown(node=path) }}
{%- endif %} {%- if record %}

{{ pin_record(entry) }}

{%- endif %} {%- endmacro %} {#- **A block on the wall is the button that opens the drawer at it** (ADR-0147 decision 7): one link to the *Notes* tab of the node its pin stands on, at that pin — `?at=` its kind, `?reason=` its line — the drawer with script, the tab without; a door as every mark is (`data-door`). Its sentence is its name, so that what a screen reader hears is what the block says and what a click opens is what it describes, and it ends in a chevron. The note, *Edit* and *Clear* are the drawer's, where the block stands whole. The source of a pin set above is named in it and not linked: the drawer it opens is that node's, whose head names it and links to its page. On the kiosk, which has nothing to be clicked, it is its sentence alone. It stands on the wall only while *◇ details* is on (decision 6): the route leaves it out of what it draws otherwise (`handled_details`). -#} {% macro wall_block(entry, scope, path, slug, bare=false, source='') -%} {%- set kept_kind = entry.kind == 'maintenance' -%} {%- set door = layout != 'kiosk' and path | url_branch -%} {%- set href = url_for('notes', path=path | url_branch, reason=slug, at=entry.kind) if slug else url_for('notes', path=path | url_branch, at=entry.kind) -%} <{{ 'a' if door else 'div' }} class="rule-block rule-block--{{ scope }} rule-block--wall{{ ' rule-block--door' if door }}" data-rule="{{ entry.kind }}"{% if door %} data-door href="{{ href }}#at"{% endif %}> {{ rule_mark(entry.kind) }}{% if not kept_kind %}{{ ack_said(entry, scope, '', bare, path) }}{% else %}{% if bare %}In maintenance{% else %}This {{ scope }} is in maintenance{% endif %}{% if source %} from {{ source }}{% endif %} {{ window_by(entry, entry | series_open, entry | ends) }}{% endif %} {%- if door %}{% endif %} {%- 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, the button that opens the drawer at it 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. `here` is the block a *Notes* tab was asked at, as a pin's `at` is. -#} {% macro config_block(at, place, path, prefix, wall=false, this='', tag='div', parent='', others=(), index=false, here=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) -%} {%- if wall -%} {#- On the wall a configured rule's block is the button that opens the drawer at it, as a person's is (ADR-0147 decision 7): one link to its node's *Notes* tab at its block under what stands (`?at=rule`, the rule by its key, `?rule=`), its sentence its name, a chevron at its end; its note is the drawer's. -#} {%- set door = layout != 'kiosk' and path | url_branch -%} <{{ 'a' if door else 'div' }} class="rule-block rule-block--node rule-block--wall{{ ' rule-block--door' if door }}{{ ' rule-block--idle' if not at.changes }}" data-rule="aggregation" data-rule-name="{{ at.rule.name }}"{% if door %} data-door href="{{ url_for('notes', path=path | url_branch, at='rule', rule=at.rule.key) }}#at"{% endif %}> {{ rule_mark('aggregation') }}{{ said | markdown_inline(node=path) }}{% if not at.changes %} · changes nothing now{% endif %} {%- if door %}{% endif %} {%- else -%} <{{ tag }}{% if here %} id="at"{% endif %} class="rule-block rule-block--{{ 'line' if place == 'lines' and not this else 'node' }}{{ ' rule-block--idle' if not at.changes }}{{ ' is-at' if here }}" data-rule="aggregation" data-rule-name="{{ at.rule.name }}">
{{ rule_mark('aggregation') }}{{ said | markdown_inline(node=path) }}{% if not at.changes %} · changes nothing now{% endif %}
{{ at.rule.note | markdown(node=path) }}

{{ 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 %}

{%- endif -%} {%- 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, `bare` is a card's sentence, whose head names the node already, and `wall` the wall's block, the button that opens the drawer of the node the pin stands on. -#} {% macro pins_above_stated(above, prefix, tag='div', bare=false, wall=false) -%} {%- for source, entry in above %} {{ pin_block(entry, 'node', source | url_branch, '', prefix ~ loop.index, false, tag=tag, bare=bare, source=source, wall=wall) }} {%- endfor %} {%- endmacro %} {#- **What a person accepted, closed or silenced**: *seen* (ADR-0142), a failure accepted as it stands — its part keeping its true color under a ringed check and counting as ok above until it changes — *done* (ADR-0146), an event looked into and over, its line showing ok with the failure it closed beside it under the same ringed check until it reads anything else, and a silence (ADR-0144), a failure that flaps, its part keeping its true color under a bell struck through and counting as ok, or at most as a warning, above through every recovery until its deadline. Its block is `pin_block`, in its kind's words; what follows is what it says, its mark on a line, and the ringed check's own editor, which posts to `POST /pins/seen` or `POST /pins/silenced` — and a block's to `POST /pins/done` as well. -#} {#- What it says, after its mark: who marked it, at which failure, and what ends it — *until it changes*, and its end and what is left where it was given one. The failure is a status placeholder, drawn as its sign (ADR-0133 decision 5). A silence says who silenced it, what it counts as — the level's sign, *at most* where it holds at a warning — and its deadline and what is left. On the wall (`bare`) the box's head names the node, and the sentence opens with the act; on a page `subject` opens it as the place says it, *This node* or *This line* by default. A done says who marked it done, the failure it closed, and that it stands until its line reads anything else. -#} {% macro ack_said(entry, scope, subject='', bare=false, path='') -%} {%- if entry.kind == 'done' -%} {%- if bare %}Done{% else %}{% if subject %}{{ subject }}{% else %}This {{ scope }}{% endif %} is marked done{% endif %} by {{ entry.set_by or 'an admin' }} {%- if entry.status %}, closing {{ ('{' ~ entry.status.name.lower() ~ '}') | markdown_inline(node=path) }}{% endif %} · until it reads anything else {%- elif entry.kind == 'silenced' -%} {%- if bare %}Silenced{% else %}{% if subject %}{{ subject }}{% else %}This {{ scope }}{% endif %} is silenced{% endif %} by {{ entry.set_by or 'an admin' }}, counting as {{ ('{' ~ entry.level.name.lower() ~ '}') | markdown_inline(node=path) }}{% if entry.level.name == 'WARN' %} at most{% endif %} until {{ instant(entry.expires_at) }} · {{ entry.expires_at | time_left }} {%- else -%} {%- if bare %}{{ entry.kind | capitalize }}{% else %}{% if subject %}{{ subject }}{% else %}This {{ scope }}{% endif %} is marked {{ entry.kind }}{% endif %} by {{ entry.set_by or 'an admin' }} {%- if entry.status %} at {{ ('{' ~ entry.status.name.lower() ~ '}') | markdown_inline(node=path) }}{% endif %} · until it changes {%- if entry.expires_at %} or {{ instant(entry.expires_at) }} · {{ entry.expires_at | time_left }}{% endif -%} {%- endif -%} {%- endmacro %} {#- A handled line's mark (ADR-0143): the mark of the job acting on it — the ringed check of a person's acceptance, § of a configured rule while it changes the line's count, ‖ of a pin — standing at the line's top right, where the room is kept for it. It is drawn in the color of what the line counts as instead, `rail`, the state its rail is drawn in, and a pinned line's in maintenance's ink, a pin counting nothing, which is what maintenance counts. Its words are its title and its hidden text: who, until when, and what the line counts as — a chip's way (ADR-0135 decision 1), the line keeping its width. **It is the line's door** (ADR-0147 decision 7): a link to its node's *Notes* tab at what handles the line, `?reason=` its slug and `?at=` the job, where the block says it in words and is changed — so that a touch screen, which shows no title, reaches them — its own box the 24-pixel target, the glyph in its middle. On the kiosk, which has nothing to be clicked, it is the mark alone. `seated` is a node's page's seat, the line's one, for whoever may set something there: the mark stands where the button that set it stood, a plain ◇ standing there where nothing handles the line (ADR-0143 decision 7). A line with no tint of its own stands on its box's fill, which a box's vivid status paints, and its glyph on its own tint (`on-fill`), as a status sign is. A silenced line counts as its rail says, or as it reads where it has none — an amber silence on a line that reads a warning, or one that recovered (ADR-0144). A line marked done shows ok and counts as ok, and its mark stands in ok's green with no rail beside it (ADR-0146). -#} {% macro line_mark(node, line, rail, link=true, seated=false) -%} {%- if line.quiet -%} {%- set kind, entry, ink, job = 'maintenance', line.maintenance, 'maintenance', 'line-pin' -%} {%- set said %}in maintenance by {{ entry.set_by or 'an admin' }} until {{ entry | ends | localtime }}{% endset -%} {%- elif line.accepted and line.acknowledgment.kind == 'done' -%} {%- set kind, entry, ink, job = 'done', line.acknowledgment, 'ok', 'line-ack' -%} {%- set said %}done by {{ entry.set_by or 'an admin' }}, closing {{ 'an error' if entry.status and entry.status.name == 'ERROR' else 'a warning' }} · counts as ok{% endset -%} {%- elif line.accepted and line.acknowledgment.kind == 'silenced' -%} {%- set reads = line.code if line.code is not none else node.reported_code -%} {%- set kind, entry, ink, job = 'silenced', line.acknowledgment, rail or reads.name.lower(), 'line-ack' -%} {%- set said %}silenced by {{ entry.set_by or 'an admin' }} until {{ entry.expires_at | localtime }} · counts as {{ ink }}{% endset -%} {%- elif line.accepted -%} {%- set kind, entry, ink, job = line.acknowledgment.kind, line.acknowledgment, rail or 'ok', 'line-ack' -%} {%- set said %}{{ entry.kind }} by {{ entry.set_by or 'an admin' }}, until it changes{% if entry.expires_at %} or {{ entry.expires_at | localtime }}{% endif %} · counts as {{ ink }}{% endset -%} {%- else -%} {%- set kind, ink, job = 'aggregation', rail or 'nothing', 'line-rule' -%} {%- set said %}counts as {{ line.rule.counts.name.lower() if line.rule.counts else 'nothing' }} by the rule {{ line.rule.rule.name }}{% endset -%} {%- endif -%} {%- set tag = 'a' if link and layout != 'kiosk' else 'span' -%} <{{ tag }} class="line-mark {{ job }} mark-{{ ink }}{{ ' on-fill' if line.code is none and not line.quiet and not (line.accepted and line.acknowledgment.kind == 'done') }}{{ ' is-seated' if seated }}"{% if tag == 'a' %} data-door href="{{ url_for('notes', path=node.path | url_branch, reason=line.slug, at='rule' if kind == 'aggregation' else kind) }}#at"{% endif %} title="{{ said[:1] | upper }}{{ said[1:] }}">{{ rule_mark(kind) }}{{ said }} {%- endmacro %} {#- Whether a line carries a mark (`line_mark`): a pin, a person's acceptance, or a configured rule while it changes the line's count. -#} {% macro line_marked(line) -%} {%- if line.quiet or line.accepted or (line.rule and line.rule.changes) %}marked{% endif -%} {%- endmacro %} {#- The editor of what a ringed check marks seen or silences (ADR-0142, ADR-0144), as a refused act comes back in it (`seen_refused.html`, `silenced_refused.html`) — a new one is set on the *Notes* tab's form (ADR-0147 decision 1): one part — a node's own failure, or one of its lines (`slug`) — or every failure at and beneath a node as it stands, each its own (`digest`, the parts' digest the route compares; `parts`, where the page knows them, listed). `what` names what it acts on; its forms claim nothing is acknowledged yet, an empty token (`ack_forms`). -#} {% macro ack_new(scope, path, slug, prefix, what='', digest='', parts=(), next='') -%}

{{ rule_mark('seen') }}Mark seen or silence {% if what %}{{ what }}{% elif scope == 'line' %}this line{% else %}this node's own failure{% endif %}.

{{ ack_parts(parts) }} {{ ack_forms(scope, path, slug, prefix, digest=digest, next=next) }}
{%- endmacro %} {#- The failing parts a head's ringed check acts on, each its own (ADR-0142 decision 5), as its editor lists them and as a refusal of its set lists them again: a line by its text, linked to it on its node, and a node by its path, its own failure. Nothing where there are none. -#} {% macro ack_parts(parts) -%} {%- if parts %} {%- endif %} {%- endmacro %} {#- The ringed check's forms (ADR-0142, ADR-0144): one editor offering what a failing part takes, *Seen* and *Silence*, each the form of its own act on the route of its own name — a seen's note and the end it may be given, a silence's note, its level and its deadline. The choice above them shows the form of the kind chosen and the stylesheet hides the other, so that the form Enter submits is the one in view; a browser that cannot tell shows both, each whole, and no choice. A new editor (`entry` none) chooses *Seen*. A block's editor (`entry`) chooses the kind that stands: its own form saves changes, and the other's makes it the other kind — the one ended and the other set in its place, in one write. `digest` is a head's, the parts it lists, each its own. Where the part fails no longer (`fails` false) — a silence that held through a recovery — the other kind, which takes a part that fails now, is not offered: the standing kind's form stands alone, with no choice above it. **A block's editor offers *Done* as well** (ADR-0146) where its part takes one: a line whose failure is an event, `event` its occurrence, that fails now — never a node's own failure, nor a head's act. The new act keeps *Seen* and *Silence*: a new done is set on the Notes tab. A done's own block chooses *Done*, its form its note alone, and offers *Seen* and *Silence* beside it, its line reading the failure it closed for as long as it stands. -#} {% macro ack_forms(scope, path, slug, prefix, entry=none, digest='', next='', fails=true, event='') -%} {%- set chosen = entry.kind if entry else 'seen' -%} {%- if entry is none -%} {%- set kinds = ('seen', 'silenced') -%} {%- elif fails -%} {%- set kinds = (('done',) if event and scope == 'line' else ()) + ('seen', 'silenced') -%} {%- else -%} {%- set kinds = (entry.kind,) -%} {%- endif -%} {%- if chosen not in kinds -%} {%- set kinds = (chosen,) + kinds -%} {%- endif -%} {%- set note = entry.note if entry else '' -%} {%- set kept = entry.expires_at | expiry_input if entry else '' -%} {%- set level = entry.level.name.lower() if entry and entry.level else 'ok' -%}
{%- if kinds | length > 1 %}
{%- for kind, word in (('done', 'Done'), ('seen', 'Seen'), ('silenced', 'Silence')) if kind in kinds %} {%- endfor %}
{%- endif %} {%- for kind in kinds %} {%- set standing = entry is not none and entry.kind == kind %} {%- set does = ack_does(kind, digest, entry) | trim %}
{{ paused_line() }} {{- panel_field() }} {%- if entry %}

{{ pin_record(entry) }}

{%- endif %} {%- if does %}

{{ does }}

{%- endif %} {%- if slug %} {%- endif %} {%- if digest %} {%- endif %} {%- if next %} {%- endif %} {%- if kind == 'seen' %} {{ maintenance_fields(note, kept if standing else '', prefix, maintenance_default, maintenance_timezone, true, kept if standing else '', ending=true) }} {%- elif kind == 'done' %} {{ done_fields(note, prefix, true, event) }} {%- else %} {{ silence_fields(note, kept if standing else '', level, prefix, silence_default, maintenance_timezone, true, kept if standing else '', changing=standing) }} {%- endif %}
{%- endfor %}
{%- endmacro %} {#- What a ringed check's form does, in a sentence above its fields: a new one's, one part's or each of a head's parts'; in a block's editor, the other kind's, which ends the one standing and sets itself in its place — and nothing for the kind that stands, whose block says it. -#} {% macro ack_does(kind, digest='', entry=none) -%} {%- if entry is not none and entry.kind != kind -%} {%- set ends = {'seen': 'the seen', 'silenced': 'the silence', 'done': 'the done'}.get(entry.kind, 'it') -%} {%- if kind == 'seen' %}Marked seen instead, {{ ends }} ends and a seen stands in its place: it keeps its color and counts as ok above until it recovers, gets worse, fails anew or is no longer reported. {%- elif kind == 'done' %}Marked done instead, {{ ends }} ends and a done stands in its place: the line shows ok with the failure it closed beside it, and counts as ok above, until it reads anything else. {%- else %}Silenced instead, {{ ends }} ends and a silence stands in its place: it keeps its color and counts above as chosen through every recovery, until its deadline.{% endif -%} {%- elif entry is none -%} {%- if kind == 'seen' -%} {%- 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 -%} {%- else -%} {%- if digest %}Each keeps its color and counts above as chosen through every recovery, until the deadline; a failure that comes later alarms.{% else %}It keeps its color and counts above as chosen through every recovery, until its deadline.{% endif -%} {%- endif -%} {%- endif -%} {%- endmacro %}