{% from '_notes.html' import entry_item, on_said, ended_said with context %} {% from '_rule_block.html' import pin_block, planned_block, pins_above_stated, config_block, rule_mark, note_mark, ack_parts, handled_mark with context %} {% from '_maintenance_fields.html' import maintenance_fields, schedule_fields, silence_fields, done_fields with context %} {% from '_why.html' import parts_beneath with context %} {% set page_title = 'Notes' %} {% include '_header.html' %} {#- A node's Notes tab, the place to act (ADR-0145): what somebody knows and did about the node, kept beside its status and never part of it (ADR-0047), on a tab of its own after History, whose number counts its entries, standing or not. At a desk two columns, on a phone one, in this order: **what fails** at and beneath the node — the parts the ringed check would mark, each linked; **a line on what came before** — how often the part was handled and noted, the last time, and the links its notes carry (decision 7); **what stands** — the pins above it, its own blocks and its lines', as *Handled* words them away from their lines, with *Edit* and *Clear* for whoever may, a pin being changed where its block stands (ADR-0104 decision 4), its configured rules, and what is handled beneath it, each part once, in every state the node is in, a node not reported now among it, beside the nearest node above it that stands — under how many parts are handled at and beneath it, *3 handled*, the number its door, ◇, says in the words it says it (ADR-0147 decision 2), where each part is the grouping's to say; **the form** — one choice over one form per kind the reader may set, each posting to the route of its own act, the stylesheet showing the chosen one's, a browser that cannot tell showing each, every kind's *On* opening on the line the tab opens on where that kind may be set on it, and script carrying the words and a part chosen after across a change of kind (decision 2), each kind's row ending, after the kind's own button, in what a package that files a ticket from the words puts there, `notes.actions`, a line beneath the row saying what it does (ADR-0148) — and beside them **what came before**, every entry whose pin no longer stands, newest first (decision 6). Whoever may set nothing reads it all without the form (decision 3), but for a small one where a package files tickets: *On* and its button, which drafts from the part chosen alone. A door opens it (ADR-0147): ◇ on a head at its top, a line's ◇ with its form on that line (`?reason=`), and a mark at the block it marks (`?at=`, `tab.at`), which carries the page's one anchor, `at`, its editor open for whoever may change it. On the wall and on a node's page the door opens it in the drawer, in its panel mode (`?panel=1`, decision 3): the same page without the site's bar, rail and band, its links leaving the frame and its forms staying in it, each sending `panel` with it, so that what answers it is drawn in the panel too, and naming the panel's address as where a write comes back to (`back`), which the drawer closes on. A write from the form comes back here; one it refuses comes back with why above the form and the words in it, the kind and the part chosen as they were, and what fails listed as it stands now. A refused edit of a note comes back in the note's editor. Not polled: it is read, as History is (ADR-0140 decision 2). -#}
{% include '_page_band.html' %}
{%- if tab.fails %}

What fails here now

{{ ack_parts(tab.fails) }}
{%- endif %} {%- set before = tab.before %} {%- if before.since %}

What came before, in one line

{%- set times = {1: 'once', 2: 'twice'} %} {%- set handled %}{% if before.handled %}handled {{ times.get(before.handled, before.handled ~ ' times') }}{% endif %}{% endset %} {%- set noted %}{% if before.noted %}noted {{ times.get(before.noted, before.noted ~ ' times') }}{% endif %}{% endset %} {%- set counts = [handled, noted] | select | join(' and ') %}

{{ counts[:1] | upper }}{{ counts[1:] }} here since {{ before.since | localtime }}.

{%- if before.last %} {%- set last = before.last %}

Last time: {{ last.word | lower }} {{ on_said(last, branch) }}, {% if last.planned %}planned as a {{ last.planned }} {% endif %}by {{ last.first.created_by or 'unknown' }} {{ last.started | localtime }} {%- if last.ran %}: {{ last.ran }}{% elif last.lasted %}, for {{ last.lasted }}{% endif %} {%- if last.ended %} — ended: {{ ended_said(last.ended, last.ended_by, last.planned) }}{% endif %}.

{%- endif %} {%- if before.links %} {%- endif %}
{%- endif %}

What stands

{%- set ruled = rules_here(node) %} {%- set above = pins_above | length %} {%- set beneath = tab.beneath %} {%- set door = door_of(node) %} {%- if above or node.maintenance_entry or node.acknowledgment or ruled or tab.lines or beneath %} {%- if door.count %}

{{ handled_mark() }}{{ door.count }} handled

{%- endif %} {%- if above or node.maintenance_entry or node.acknowledgment or ruled or tab.lines %}
    {{- pins_above_stated(pins_above, 'tab-above-', tag='li') }} {%- if node.maintenance_entry %} {{ pin_block(node.maintenance_entry, 'node', node.path, '', 'tab-maintenance', may_maintenance, tag='li', subject='The whole node' | safe, record=true, next=back, also=above > 0, at=tab.at.on('maintenance'), ran=tab.ran.get('')) }} {%- endif %} {%- if node.acknowledgment %} {{ pin_block(node.acknowledgment, 'node', node.path, '', 'tab-ack', may_done if node.acknowledgment.kind == 'done' else may_seen if node.acknowledgment.kind == 'seen' else may_silence, tag='li', subject=('Its own part' if node.acknowledgment.kind == 'silenced' else 'Its own failure') | safe, record=true, next=back, fails=node.own_code.name in ('WARN', 'ERROR'), at=tab.at.on(node.acknowledgment.kind)) }} {%- endif %} {%- for here in ruled %} {{ config_block(here.at, here.place, node.path, 'tab-rule-' ~ loop.index, this='**this node**', tag='li', parent=here.parent, others=here.others, here=loop.index == tab.at.rule) }} {%- endfor %} {%- for line in tab.lines %} {%- set subject %}{% if line.text %}{{ line.text | markdown_inline(node=node.path) }} — this line{% else %}A line not reported now{% endif %}{% endset %} {%- if line.maintenance %} {{ pin_block(line.maintenance, 'line', node.path, line.slug, 'tab-line-' ~ loop.index, may_maintenance, tag='li', also=node.maintenance_entry is not none or above > 0, subject=subject, record=true, next=back, at=tab.at.on('maintenance', line.slug), ran=tab.ran.get(line.slug)) }} {%- endif %} {%- if line.acknowledgment %} {{ pin_block(line.acknowledgment, 'line', node.path, line.slug, 'tab-line-ack-' ~ loop.index, may_done if line.acknowledgment.kind == 'done' else may_seen if line.acknowledgment.kind == 'seen' else may_silence, tag='li', subject=subject, record=true, next=back, fails=line.fails, event=line.occurrence if line.fails else '', at=tab.at.on(line.acknowledgment.kind, line.slug)) }} {%- endif %} {%- endfor %}
{%- endif %} {%- if beneath %}
{{ parts_beneath(tab) }}
{%- endif %} {%- else %}

Nothing stands here now: no pin, nothing a person marked done or seen or silenced, and no rule.

{%- endif %}
{#- **Planned** (ADR-0150, decision 5 of #35's note): what is planned for the node and its lines, the soonest first, beneath what stands and never among it — a window set ahead or a series between two of its windows holds nothing, so the door, ◇, counts none of it and the list has a count of its own. A planned set lands here, at its block (`tab.at`). -#} {%- set planned = planned_here(node) %} {%- if planned %}

Planned

{{ planned | planned_count }} planned, the soonest first.

    {%- for item in planned %} {%- set subject %}{% if not item.slug %}The whole node{% elif item.reported %}{{ item.text | markdown_inline(node=node.path) }} — this line{% else %}A line not reported now{% endif %}{% endset %} {{ planned_block(item.planned, 'line' if item.slug else 'node', node.path, item.slug, 'tab-planned-' ~ loop.index, may_maintenance, tag='li', subject=subject, record=true, next=back, at=tab.at.on('maintenance', item.slug), ran=tab.ran.get(item.slug)) }} {%- endfor %}
{%- endif %} {%- if tab.offered %}

Handle it

{%- if refused and not editing %} {%- endif %} {%- set words = mine if not editing else '' %}
{%- if tab.offered | length > 1 %}
{%- for each in tab.offered %} {%- endfor %}
{%- endif %} {%- for each in tab.offered %} {%- set kind = each.kind %} {%- set chosen = kind.name == tab.chosen %} {%- set mine_here = words if chosen else '' %}
{{- panel_field(back=back if kind.name == 'note' else '') }} {%- if kind.name == 'note' %} {%- else %} {%- if kind.on_failures and tab.digest %} {%- endif %} {#- the event each line it may close reads as the tab was drawn, which the route compares (ADR-0146) -#} {%- if kind.on_events %} {%- for target in each.targets %} {%- endfor %} {%- endif %} {%- endif %}

{{ kind.does }}

{%- if kind.name == 'note' %}
Markdown is supported; raw HTML is shown as text.
{%- elif kind.name == 'done' %} {{ done_fields(mine_here, 'form-done', true) }} {%- elif kind.name == 'seen' %} {{ maintenance_fields(mine_here, fields.get('duration', '') if chosen else '', 'form-seen', maintenance_default, maintenance_timezone, true, ending=true) }} {%- elif kind.name == 'silenced' %} {{ silence_fields(mine_here, fields.get('deadline', '') if chosen else '', (fields.get('level', '') if chosen else '') or 'ok', 'form-silenced', silence_default, maintenance_timezone, true) }} {%- elif kind.name == 'maintenance' %} {#- a part an entry stands on carries that entry's token, and a window set there joins it, or replaces it where chosen (ADR-0150, landing 4; #35's note, decision 2) -#} {%- if each.entries %} {%- for part, standing in each.entries.items() %} {%- endfor %}
Where a schedule stands on the part chosen
{%- endif %} {{ schedule_fields(editor if (editor and chosen) else new_editor(mine_here), 'form-maintenance', maintenance_default, maintenance_timezone, true) }} {%- endif %} {#- a package's button that files a ticket from this form, after the kind's own, which stays the form's default for Enter (ADR-0148) -#} {%- set filing = slot('notes.actions', node=node, kind=kind.name, draft_action=url_for('draft', path=branch, kind=kind.name)) %}
{%- if filing %} {{ filing }} {%- endif %}
{%- if filing %}

Opens a draft in a new tab, its summary the words' first line. Paste the issue's link into the words before you save.

{%- endif %}
{%- endfor %}
{%- else %} {#- whoever may set no kind still files a ticket, from the part alone, where a package fills the slot: a form of its own that leaves the frame, as the button does (ADR-0148) -#} {%- set filing = slot('notes.actions', node=node, kind='', draft_action=url_for('draft', path=branch)) %} {%- if filing %}

File it

{{ filing }}

Opens a draft of the part chosen in a new tab.

{%- endif %} {%- endif %}

What came before

{%- if tab.history %}
    {%- for shown in tab.history %} {{ entry_item(shown, branch, loop.index, editing=editing, mine=mine, refused=refused) }} {%- endfor %}
{%- else %}

Nothing was handled or noted here before.

{%- endif %}
{% include '_page_end.html' %}