{#- A node's own lines, as its own page lists them — a leaf's page and a branch's (ADR-0036 decision 12): every line in full, uncapped, with the same ``reason.actions`` slot (ADR-0034) beside each one, so a deployment's "raise a ticket" button is everywhere the line itself is. ``surface`` tells a filler which page it is on: `check` for a leaf's, which is not polled, and `grid` for a branch's, which is. This is also the surface for **per-entry maintenance** (ADR-0036): where a check declared its lines as members, one finding somebody is working on can go quiet while its nineteen siblings keep alarming. Where the reader may pin (``may``), each such line ends in a pause mark, on a seat in the rail the line's other actions share; it opens the pin's editor beneath the line, where its block will stand (ADR-0104 decisions 3 and 4). A quiet line stays visible in the maintenance tint and carries that block — who silenced it and until when, its note, *Edit* and *Clear*. Prose gets no mark: its unit of suppression is the node pin, and a per-line control there would offer to silence half of one condition. **Any line takes a pin, whatever it says**, as a node does: a pin is an admin's intent, set ahead of the work as readily as on a failure. `?reason=` names one line (decision 12): the maintenance index links here with it, and a line's set, edit and clear come back with it, because on a node with 150 findings arriving at the right *page* is not the same as arriving at the *line*. The named line (``focus``) — and only it — gets the `pinned-reason` id, so one anchor exists instead of one per line, and only when it was asked for. ``beneath`` says the node has nodes beneath it, read before a filter drops one: a pin on one of its lines silences that line and nothing beneath it (ADR-0124), which the editor of its last line still alarming says where a leaf's says that nothing is left to alarm. ``back`` is the page a write comes back to, at its line (``at_line``) — a branch's page as it was asked for, its depth and its filters kept; a leaf's page leaves it empty, and the write's own answer is the node's page at the line. ``path`` is the node's, ``prefix`` keeps the editors' field ids apart from the others on the page. The lines stand on a status fill — a page's head, the one card of `depth=0` — vivid where the node fails of its own, so a record and a refusal take their line's ink, never Bootstrap's muted gray (`_record_list.html`). ``covered`` counts the pins above the node, which silence it and every line with it: a line's pin is then, as under the node's own, for the day those end (ADR-0104 decision 2). **A line that fails now takes a ringed check beside its pause mark** (ADR-0142), where the reader may mark it seen, nothing holds it in maintenance and nobody has yet: it opens the line's own editor beneath it, as the pause mark does, and the line marked seen keeps its color with the ringed check before its words, its block beneath it — who marked it, at which failure, until it changes, its note, *Edit* and *Clear*. -#} {% from '_rule_block.html' import pin_block, pin_new, rule_mark, line_rule_mark, line_ack_mark, ack_new with context %} {% from '_status_cue.html' import status_cue %} {% from '_record_list.html' import record_list %} {% macro own_lines(node, path, may, focus='', focus_orphan=none, beneath=false, back='', surface='check', prefix='reason-maintenance-', covered=0, folded=false) -%} {%- set pin = node.maintenance_entry %} {#- What a line's pin leaves alarming beside it. A line that is pinned already is not one that keeps alarming, and under the node's pin nothing alarms at all — there a line's pin is for the day the node's ends. -#} {%- set others = node.reasons | rejectattr('quiet') | list | length - 1 %} {%- set line_covers %} {%- if pin -%} It stays in maintenance when the node's pin ends. {%- elif covered -%} It stays in maintenance when the {{ 'pin' if covered == 1 else 'pins' }} above the node {{ 'ends' if covered == 1 else 'end' }}. {%- elif others > 1 -%} The other {{ others }} keep alarming. {%- elif others == 1 -%} The other one keeps alarming. {%- elif beneath -%} No other line of its own is left to alarm, and the nodes beneath it still count. {%- else -%} No other line is left to alarm. {%- endif -%} {%- endset %} {#- Nothing to list and no absent line to name: no block at all, so a node that says nothing of itself gains no empty box. -#} {%- if node.reasons or focus_orphan %}
{%- if focus_orphan %} {#- The pin is real and its line is absent: a slug the current run did not report is **suspended, not deleted** (decision 6). Say so — this is the one surface that can, and an anchor that simply failed to scroll would have left the operator guessing. -#}
The line this pin was set on is no longer reported by this check. The pin is still here and still expires {{ focus_orphan.expires_at | localtime }}; if the line comes back, it comes back in maintenance.
{%- endif %} {% for line in node.reasons %} {%- set focused = focus and line.slug == focus %} {%- set settable = may and node.members and not line.quiet %} {%- set reads = line.code if line.code is not none else node.reported_code %} {%- set acceptable = settable and not line.acknowledgment and not pin and not covered and node.reported_code.name != 'MAINTENANCE' and reads.name in ('WARN', 'ERROR') %} {%- set next = back | at_line(line.slug) if back else '' %} {#- A coded line carries its own claim (ADR-0042): state class, its state's own tint, and a labeled cue as its accessible name; quiet keeps the maintenance tint over any code, and is-running is display only — the words still say it. `data-healthy` marks what the healthy fold folds (ADR-0127 decision 4): on a node's own page the head's funnel folds its healthy lines, which are never clamped and keep the check's order (backlog #91 §3.3) — and `data-fold-drawn` beside it what the node's configured fold folds from the first paint (`folded`, ADR-0128), until `tree.js` folds it itself. -#}
{#- The box the pause mark is placed in: the line's own paddings differ with its state, and the mark has to sit where the rail does. -#}
{{ slot('reason.actions', node=node, reason=line.text, line=line, index=loop.index0, surface=surface) }}
{% if line.code %}{{ status_cue(line.code, labeled=true) }}{% endif %}{% if line.accepted %}{{ line_ack_mark(line) }}{% endif %}{% if line.rule and line.rule.changes %}{{ line_rule_mark(line.rule) }}{% endif %}{{ line.text | markdown(node=node.path) }}
{#- The form the line was written from (ADR-0126), where its grading named one: the key a check's `display:` block re-words this line under, so the reader who wants the line to say more learns here what to write — and the grading that decided its code (ADR-0131), where one did: the name whose keys the check's configuration writes to grade the line differently. One paragraph, beside the line and above its record, on the node's own page only. -#} {%- if line.form or line.grading %}

{%- if line.form %}Written from the form {{ line.form }}{% endif %} {%- if line.grading %}{{ ' · graded by ' if line.form else 'Graded by ' }}{{ line.grading }}{% endif -%}

{%- endif %} {#- The record (backlog #32): what the check read about this line's subject, beside the sentence it wrote. A list of dotted names and values — its times in the configured timezone, everything else as stored — on the node's own page only: a card shows the line, and this is the surface a reader comes to when the line is not enough. -#} {%- if line.data %} {{ record_list(line.data, muted=false) }} {#- Where the seam refused the record (ADR-0093), the line stands as its grading wrote it and this says why, in the record's place — escaped like any other data, since a why may quote the value it refused. -#} {%- elif line.refused %}

Record refused: {{ line.refused }}

{%- endif %} {%- if settable %} {#- After the line's text in the document, so the editor opens beneath it in the flow; the mark itself is drawn on its seat in the rail. A mark and not the two words: on a node with 150 lines the words were a column of their own. -#}
{{ rule_mark('maintenance') }}Set maintenance for this line {#- A line's note is written from the line too, as its pin is set (ADR-0140 decision 3): the node's Notes view, the line chosen. -#} {{ pin_new('line', line_covers, path, line.slug, prefix ~ loop.index, next=next, notes=url_for('notes', path=path | url_branch, reason=line.slug) ~ '#add-note') }}
{%- elif line.quiet %} {{ pin_block(line.maintenance, 'line', path, line.slug, prefix ~ loop.index, may, also=pin is not none or covered, next=next) }} {%- endif %} {%- if acceptable %} {#- The ringed check, on its seat beside the pause mark: marks this line seen, as it stands (ADR-0142). -#}
{{ rule_mark('seen') }}Mark this line seen {{ ack_new('line', path, line.slug, prefix ~ 'seen-' ~ loop.index, next=next) }}
{%- endif %} {%- if line.acknowledgment %} {{ pin_block(line.acknowledgment, 'line', path, line.slug, prefix ~ 'seen-' ~ loop.index, may, next=next) }} {%- endif %}
{% endfor %} {% if node.quiet_reasons %} {#- "nothing here is reporting" explains a node that went blue because its last member was pinned. Under a **node** pin, the node's own or one above it, it would take credit for the wrong thing — the block above already says why — so the count then reports only what stays quiet once that pin is cleared; and above other nodes it would be untrue, since they still count (ADR-0124). -#}
{{ node.quiet_reasons }} of {{ node.reasons | length }} {% if node.maintenance or covered %}also pinned individually{% else %}in maintenance{% if node.own_code.name == 'MAINTENANCE' and not beneath %} — nothing here is reporting{% endif %}{% endif %}.
{% endif %}
{%- endif %} {%- endmacro %}