{#- A node's entries as a page states them (ADR-0140, ADR-0145 decision 6): its Notes tab's history, and the page of a path no node stands at, which lists the entries written for it and beneath it. **An entry** is a note of its own or the record of a pin, an act's one entry however many parts it covered (decision 5). It says its kind by its mark and its word; what it was on — the node, one of its lines by its text, linked to it where the run reports it and marked where it does not, since a line that is not reported is suspended, not gone (ADR-0047 decision 8), or an act's parts, listed in a fold, how many it had in all and where it was made where that is another node; from when to when and how long; who; a seen's status and a silence's level, as a block draws them; why it ended and by whom, in the log's words; its words, an admin's Markdown; and folded beneath them what the node showed then (ADR-0047 decision 6) — its status and its lines, each line on its status's tint. A note of its own says who wrote it and when, who changed it last, and keeps its *Edit* while it is the newest on its node. A pin's note written before a note kept its kind says what it said: the note of a pin that has ended. Nothing here is a status of the node now. `entry_item` takes a `notes_tab.Shown`; `path` is the node's, as its address writes it, and empty on the page of a gone path, where nothing links to a line and nothing is edited, and where `at` names the path an entry stands at when it is one beneath the page's own. `mine` are the words a refused edit brought back, in the editor `editing` names, with why it was refused (`refused`). In the panel the drawer frames (ADR-0147 decision 3) a note's editor stays in the frame and comes back to the panel's address, the tab's `back`. -#} {% from '_rule_block.html' import rule_mark, note_mark with context %} {% macro note_context(note) -%} {%- set context = note.context %}
What {{ 'the line' if note.slug else 'the node' }} showed then

{% if context.code %}The node showed {{ context.code }}{% else %}No node stood there{% endif %} {%- if context.lines %}, {{ 'and the line read' if note.slug else 'and its lines read' }}:{% else %}.{% endif %}

{%- if context.lines %} {#- A line's status where it declares one, in a column of its own only where one of them does: a line that declares none carries its node's. -#} {%- set coded = context.lines | selectattr('code') | list %}
{%- for line in context.lines %} {%- if coded %} {%- endif %} {%- endfor %}
{{ line.code }}{{ line.text | markdown_inline(node=note.path) }}
{%- if context.more %}

And {{ context.more }} more {{ 'line' if context.more == 1 else 'lines' }}.

{%- endif %} {%- endif %}
{%- endmacro %} {#- An entry's mark: its kind's — ‖, the ringed check, the bell struck through — and the note's bubble for a note of its own. -#} {% macro entry_mark(shown) -%} {%- if shown.first.pin and shown.kind -%}{{ rule_mark(shown.kind) }}{%- else -%}{{ note_mark() }}{%- endif -%} {%- endmacro %} {#- A part an entry is on, by its line — its text, and *its line* linked to it on its node where the run reports it — or by its node. `here` is the tab's node, whose own lines need no path; `path` empty is a gone path's page, which links nothing. -#} {% macro part_said(part, here, path) -%} {%- if part.slug -%} {%- set whose = 'its line' if part.path == here else 'a line of ' ~ part.path -%} {%- if path and part.reported %}{{ whose }}{% else %}{{ whose }}{% endif %} {%- if part.line %}: {{ part.line | markdown_inline(node=part.path) }}{% endif %} {%- if not part.reported %} — the check does not report it now{% endif %} {%- elif part.path == here -%} the node {%- elif path -%} {{ part.path }} {%- else -%} {{ part.path }} {%- endif -%} {%- endmacro %} {#- What an entry was on, after its word: its one part, or how many parts of one act, and where the act was made where that is another node than the tab's. -#} {% macro on_said(shown, path) -%} {%- set alone = shown.alone -%} {%- set parts = shown.parts | length -%} {%- if alone -%} on {{ part_said(alone, shown.here, path) }} {%- if shown.in_all > 1 %}, one of {{ shown.in_all }} parts of one act{% endif -%} {%- else -%} {{ parts }} {{ 'part' if parts == 1 else 'parts' }}{% if shown.in_all > parts %} of {{ shown.in_all }}{% endif %} in one act {%- endif -%} {%- if shown.made_at %}, made on {% if path %}{{ shown.made_at }}{% else %}{{ shown.made_at }}{% endif %}{% endif -%} {%- endmacro %} {#- Why a pin ended and by whom, in the log's words (ADR-0145 decision 6) — for an entry planned as a window or a schedule (`planned`), an end at its end *with its last window* (ADR-0150). -#} {% macro ended_said(ended, by, planned='') -%} {{ ended_word(ended, planned) or 'it ended' }}{% if by %}, by {{ by }}{% endif %} {%- endmacro %} {#- A seen's status, the failure a done closed and a silence's level, as a block draws them (ADR-0133 decision 5): placeholders, drawn as their signs — an act's part by part, each its own. -#} {% macro held_at(kind, note) -%} {%- if kind == 'seen' and note.status %} at {{ ('{' ~ note.status.name.lower() ~ '}') | markdown_inline(node=note.path) }} {%- elif kind == 'done' and note.status %}, closing {{ ('{' ~ note.status.name.lower() ~ '}') | markdown_inline(node=note.path) }} {%- elif kind == 'silenced' and note.level %}, counting as {{ ('{' ~ note.level.name.lower() ~ '}') | markdown_inline(node=note.path) }}{% if note.level.name == 'WARN' %} at most{% endif %}{% endif -%} {%- endmacro %} {% macro entry_item(shown, path, index, editing='', mine='', at='', refused='') -%} {%- set first = shown.first %} {%- set record = first.pin and shown.kind %}
  • {%- if at %}At {{ at }}. {% endif -%} {{ shown.word }} · {{ on_said(shown, path) }} {{ shown.started | localtime }} {%- if record and shown.ended_at %} → {{ shown.ended_at | localtime }} · {{ shown.ran or shown.lasted }}{% endif %}

    {%- if record -%} {% if shown.planned %}Planned as a {{ shown.planned }} by{% else %}By{% endif %} {{ first.created_by or 'unknown' }}{% if shown.alone %}{{ held_at(shown.kind, first) }}{% endif %} {%- if shown.ended %} · ended: {{ ended_said(shown.ended, shown.ended_by, shown.planned) }}{% elif not shown.standing %} · it has ended{% endif %}. {%- if first.set_at != first.created_at %} Last changed by {{ first.set_by or 'unknown' }} {{ first.set_at | localtime }}.{% endif %} {%- else -%} Written by {{ first.created_by or 'unknown' }} {%- if first.set_at != first.created_at %}, last changed by {{ first.set_by or 'unknown' }} {{ first.set_at | localtime }}{% endif %}. {%- if first.pin %} The note of a pin that has ended.{% endif %} {%- endif %}

    {%- if shown.text %}
    {{ shown.text | markdown(node=first.path) }}
    {%- endif %} {%- if shown.alone %} {{ note_context(first) }} {%- else %} {#- An act's parts, each by its line or its node, and when each ended where that was before the act's last. -#}
    The {{ shown.parts | length }} {{ 'part' if shown.parts | length == 1 else 'parts' }}{% if shown.in_all > shown.parts | length %} here, of {{ shown.in_all }}{% endif %}
      {%- for part in shown.parts %}
    • {{ part_said(part, shown.here, path) }}{{ held_at(shown.kind, part.note) }} {%- if part.note.ended_at and part.note.ended_at != shown.ended_at %} — ended {{ part.note.ended_at | localtime }}: {{ ended_said(part.note.ended, part.note.ended_by) }}{% endif %}
    • {%- endfor %}
    {%- endif %} {%- if path and shown.editable %}
    Edit
    {{- panel_field(back=back) }} {%- if refused and editing == first.key %} {%- endif %}
    Markdown is supported; raw HTML is shown as text. A note is changed while it is the newest on its node.
    {%- endif %}
  • {%- endmacro %}