summaryrefslogtreecommitdiff
path: root/web/templates/page-session.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'web/templates/page-session.tmpl')
-rw-r--r--web/templates/page-session.tmpl70
1 files changed, 70 insertions, 0 deletions
diff --git a/web/templates/page-session.tmpl b/web/templates/page-session.tmpl
new file mode 100644
index 0000000..1155b67
--- /dev/null
+++ b/web/templates/page-session.tmpl
@@ -0,0 +1,70 @@
+{{/* One session's conversation, with its notevi log woven in by time. */}}
+{{define "page-session"}}
+{{$c := .Conv}}
+<header class="filehead">
+ <h1>
+ {{if $c.Agent}}<span class="chip am{{$c.Bit}}">{{$c.Agent}}</span> {{end}}
+ <code title="{{$c.Session}}">{{short $c.Session}}</code>
+ </h1>
+ <p class="meta">
+ {{if $c.Model}}{{$c.Model}} · {{end}}{{$c.Reads}} reads · {{$c.Greps}} greps · {{$c.Notes}} notes
+ {{if $c.Dir}} · <span title="{{$c.Dir}}">{{base $c.Dir}}</span>{{end}}
+ {{if $c.Harness}} · {{$c.Harness}}{{end}}
+ </p>
+ {{if $c.Path}}
+ <p class="meta"><code>{{$c.Path}}</code></p>
+ {{else}}
+ <p class="meta hint">no transcript found for this session — searched
+ {{if $c.Roots}}{{range $i, $r := $c.Roots}}{{if $i}}, {{end}}<code>{{$r}}</code>{{end}}{{else}}nowhere: <code>-transcripts</code> is empty{{end}} ·
+ showing the notevi log alone</p>
+ {{end}}
+ {{if $c.Err}}<p class="err">{{$c.Err}}</p>{{end}}
+</header>
+
+<section class="convpage">
+ {{if $c.Windowed}}
+ <p class="meta">
+ moments {{$c.From}}–{{$c.To}} of {{$c.Total}}{{if $c.Anchor}}, around the note{{end}} ·
+ {{if $c.Incomplete}}the rest is beyond what one page renders{{else}}<a href="{{$c.AllHref}}">show the whole conversation</a>{{end}}
+ </p>
+ {{end}}
+
+ <div class="conv" data-anchor="{{$c.Anchor}}">
+ {{range $c.Turns}}
+ {{if .Note}}
+ <div class="turn t-note{{if .Here}} here{{end}}">
+ <span class="role">note</span><time>{{.Clock}}</time>
+ {{if .Note.File}}
+ <div class="notewrap" data-href="{{$.NoteHref .Note}}" tabindex="0" role="link"
+ title="open this note on the code it is about">{{template "note" (dict "N" .Note "P" $)}}</div>
+ {{else}}
+ <div class="notewrap">{{template "note" (dict "N" .Note "P" $)}}</div>
+ {{end}}
+ </div>
+ {{else if eq .Role "notevi"}}
+ <div class="turn t-notevi">
+ <span class="role">notevi</span><time>{{.Clock}}</time>
+ {{if .File}}<a class="what" href="{{$.Href "code" .File}}">{{.Text}}</a>
+ {{else}}<span class="what">{{.Text}}</span>{{end}}
+ </div>
+ {{else if eq .Role "tool"}}
+ <div class="turn t-tool">
+ <span class="role">{{.Tool}}</span><time>{{.Clock}}</time>
+ <code class="what">{{.Detail}}</code>
+ </div>
+ {{else if eq .Role "result"}}
+ <div class="turn t-result{{if eq .Kind "error"}} bad{{end}}">
+ <span class="role">→{{if .Tool}} {{.Tool}}{{end}}</span><time></time>
+ <code class="what">{{.Detail}}</code>
+ </div>
+ {{else}}
+ <div class="turn t-say t-{{.Role}}">
+ <span class="role">{{.Role}}</span><time>{{.Clock}}</time>
+ <p>{{.Text}}</p>
+ </div>
+ {{end}}
+ {{end}}
+ {{if not $c.Turns}}<p class="meta hint">nothing recorded for this session</p>{{end}}
+ </div>
+</section>
+{{end}}