{{/* The review-thread markup, defined once and parsed into every page set. The diff renderer (web/diff.go) executes "blockthreads" into the HTML it builds for one block, and the proposal page renders "thread" directly for the comments whose anchor no longer names a block. Both go through html/template rather than string building because a comment body is prose someone else wrote: contextual auto-escaping is what keeps it text. */}} {{define "thread"}}
{{.Author}} {{if .Agent}}agent{{end}} {{.When}} {{if .Resolved}}resolved{{end}} {{if .Note}}{{.Note}}{{end}} {{if .DocPath}}{{.DocPath}}{{end}} {{/* What this thread is attached to, spelled out. The reviewer selected lines; the comment stores a block under a heading path, and by the time anyone reads the thread the heading is usually off screen. It comes last and behind a separator because the badge in front of it is a warning about fit while this is a locator. Run together they read as one sentence, and "block edited since Storage › Goals" is a phrase the reader has to un-parse before noticing it is two unrelated facts. */}} {{if .AnchorPath}}· {{.AnchorPath}} ¶{{.AnchorIndex}}{{end}}
{{.Body}}
{{range .Replies}}
{{.Author}} {{if .Agent}}agent{{end}} {{.When}}
{{.Body}}
{{end}}
{{if .CanReply}}
Reply
{{end}} {{if .CanResolve}}
{{end}}
{{end}} {{define "blockthreads"}} {{if .Threads}}
{{range .Threads}}{{template "thread" .}}{{end}}
{{end}} {{if .Compose}}
Comment on this block {{/* Selection is by line, anchoring is by block, so the composer states which block it will anchor to before anything is typed. It is rendered here, on the server, rather than filled in by the selection script: with JavaScript off there is no selection and this sentence is the whole truth about where the comment lands. The script prefixes the selected line range onto it as its own element and removes that element again on Escape, so there is nothing here to repeat as a plain-text copy for restoring: writing such a copy back would have to go through textContent, which would flatten the code element below. */}}

Anchors to {{.Compose.AnchorPath}} ¶{{.Compose.AnchorIndex}}

{{end}} {{end}}