summaryrefslogtreecommitdiff
path: root/vrsite/templates/frag-note.tmpl
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-30 17:05:12 -0300
committerGabriel Schneider <[email protected]>2026-07-30 17:56:23 -0300
commit8ec4e135e318c7799b2576a8729493c063da4a97 (patch)
treeab37cdbb7f478eb996264cf941891f127f303c85 /vrsite/templates/frag-note.tmpl
parentcb05c363045bf0e7af5858f6d7bc26f026fa9d70 (diff)
downloadnotevi-8ec4e135e318c7799b2576a8729493c063da4a97.tar.gz
notevi-8ec4e135e318c7799b2576a8729493c063da4a97.zip
Diffstat (limited to 'vrsite/templates/frag-note.tmpl')
-rw-r--r--vrsite/templates/frag-note.tmpl18
1 files changed, 13 insertions, 5 deletions
diff --git a/vrsite/templates/frag-note.tmpl b/vrsite/templates/frag-note.tmpl
index 56f7a8f..0c3182c 100644
--- a/vrsite/templates/frag-note.tmpl
+++ b/vrsite/templates/frag-note.tmpl
@@ -1,7 +1,8 @@
-{{define "note"}}{{$n := .N}}{{$p := .P}}
-<article class="note am{{$n.Agent.Bit}}" id="note-{{$n.ID}}"
+{{define "note"}}{{$n := .N}}{{$p := .P}}{{$away := and $n.Change $p.ChangeID (ne $n.Change $p.ChangeID)}}
+<article class="note am{{$n.Agent.Bit}}{{if $away}} away{{end}}" id="note-{{$n.ID}}"
data-agent="{{$n.Agent.Name}}" data-model="{{$n.Model}}" data-session="{{$n.Session}}"
- data-kind="{{$n.Kind}}" data-file="{{$n.File}}" data-date="{{if not $n.At.IsZero}}{{$n.At.Format "2006-01-02"}}{{end}}">
+ data-kind="{{$n.Kind}}" data-file="{{$n.File}}" data-date="{{if not $n.At.IsZero}}{{$n.At.Format "2006-01-02"}}{{end}}"
+ data-start="{{$n.Start}}" data-end="{{$n.End}}">
<header>
{{if $n.File}}<a href="{{$p.NoteHref $n}}" title="{{$n.File}}">{{base $n.File}}{{lines $n}}</a>{{end}}
{{if $n.Kind}}<em>{{$n.Kind}}</em>{{end}}
@@ -12,7 +13,12 @@
{{if not $n.At.IsZero}}<time datetime="{{$n.At.Format "2006-01-02T15:04:05Z07:00"}}" title="{{$n.Ago}}">{{$n.When}}</time>{{end}}
{{if $n.Model}}<span class="model">{{$n.Model}}{{if $n.Reason}}/{{$n.Reason}}{{end}}</span>{{end}}
{{if $n.Session}}<code class="sess" title="{{$n.Session}}">{{short $n.Session}}</code>{{end}}
- {{if $n.Change}}{{if $p.Live}}<a href="{{$p.Href "change" $n.Change}}"><code>{{short $n.Change}}</code></a>{{else}}<code>{{short $n.Change}}</code>{{end}}{{end}}
+ {{with $p.ConvHref $n}}<a class="conv" href="{{.}}" title="open the conversation this note was written in">conversation</a>{{end}}
+ {{if $n.Change}}
+ {{if $p.Live}}<a class="atchg{{if $away}} away{{end}}" href="{{$p.Href "change" $n.Change}}"
+ title="{{if $away}}written at another change{{else}}written at this change{{end}}"><code>{{short $n.Change}}</code></a>
+ {{else}}<code class="atchg{{if $away}} away{{end}}">{{short $n.Change}}</code>{{end}}
+ {{end}}
</footer>
</article>
{{end}}
@@ -30,6 +36,8 @@
hx-on::after-request="if(event.detail.successful){this.reset();{{if eq .Kind "notes"}}htmx.trigger('#notefilters','change');{{end}}}"
method="post" action="{{.Href "notes"}}">
<input type="hidden" name="rev" value="{{.Rev}}">
+ <input type="hidden" name="change" value="{{.ChangeID}}">
+ <input type="hidden" name="scope" value="{{.Scope}}">
<input type="hidden" name="back" value="{{if .File}}{{.Href "code" .File.Path}}{{else}}{{.Href "notes"}}{{end}}">
<div class="row">
{{if .File}}
@@ -44,7 +52,7 @@
</div>
<textarea name="text" rows="3" placeholder="comment… (⌘/ctrl+enter to post)" required></textarea>
<div class="row end">
- <span class="meta">as <b>{{.User}}</b> → the log</span>
+ <span class="meta">as <b>{{.User}}</b> at <code title="{{.ChangeID}}">{{short .ChangeID}}</code> → the log</span>
<button type="submit">add note</button>
</div>
</form>