clone

a self-hosted multitenant nostr relay with sites, file storage, git hosting, and inbox and outbox delivery

follow the room's scroll container on phones and say reply for one reply

Dami committed 8d19b39
commit
8d19b39eb7c92dd7a51b17e3ada233e5d23dd403
parent
c952f590df1d3710b42ae0d5115554581f009cef
author
Dami <dami.etoile@gmail.com>
3 files changed, +8 -8
Minternal/webui/components.js8++++----
Minternal/webui/rooms.html4++--
Minternal/webui/rooms_test.go4++--
M internal/webui/components.js +4 -4
M internal/webui/rooms.html +2 -2
@@ -43,7 +43,7 @@
4343 </section>4444 {{else}}{{$data := asMap .Event}}{{$room := asMap (index $data "room")}}{{$id := str (index $room "id")}}{{$root := roomRoot .Event}}<section id="thread">4545 <p id="crumbs"><a href="/rooms/{{$id}}">{{or (str (index $room "name")) $id}}</a></p>46-<h1>Thread <small>{{$root.Replies}} replies</small></h1>46+<h1>Thread <small>{{$root.Replies}} {{if eq $root.Replies 1}}reply{{else}}replies{{end}}</small></h1>4747 <div id="root">{{template "roomMessage" $root}}</div>4848 <div id="messages">{{range roomItems .Event "replies"}}4949 {{template "roomMessage" .}}{{else}}<p id="empty">No replies yet.</p>{{end}}
@@ -60,5 +60,5 @@
6060 {{define "roomMessage"}}<room-message id="msg-{{.ID}}" data-id="{{.ID}}" data-kind="{{.Kind}}" data-pubkey="{{.PubKey}}"{{if .Agent}} data-agent{{end}}{{if .Notice}} data-notice{{end}}>6161 <header><b>{{template "nostrKey" .PubKey}}</b>{{if .Role}} | {{.Role}}{{end}}<small><time datetime="{{datetime .CreatedAt}}" title="{{when .CreatedAt}}">{{clock .CreatedAt}}</time></small></header>6262 <p>{{if .Notice}}{{.Notice}}{{else}}{{roomContent .Content}}{{end}}</p>63-{{if or .Mentions (and (not .InThread) (or (eq .Kind "11") .Root)) .Reactions}}<footer>{{if .Mentions}}<span>to {{range .Mentions}}{{template "nostrKey" .}} {{end}}</span>{{end}}{{if not .InThread}}{{if eq .Kind "11"}}<a href="/rooms/{{.Room}}/thread/{{.ID}}">thread{{if .Replies}} | {{.Replies}} replies{{end}}</a>{{else if .Root}}<a href="/rooms/{{.Room}}/thread/{{.Root}}">in thread</a>{{end}}{{end}}{{range .Reactions}}<span data-reaction="{{.Content}}">{{.Content}} {{.Count}}</span>{{end}}</footer>{{end}}63+{{if or .Mentions (and (not .InThread) (or (eq .Kind "11") .Root)) .Reactions}}<footer>{{if .Mentions}}<span>to {{range .Mentions}}{{template "nostrKey" .}} {{end}}</span>{{end}}{{if not .InThread}}{{if eq .Kind "11"}}<a href="/rooms/{{.Room}}/thread/{{.ID}}">thread{{if .Replies}} | {{.Replies}} {{if eq .Replies 1}}reply{{else}}replies{{end}}{{end}}</a>{{else if .Root}}<a href="/rooms/{{.Room}}/thread/{{.Root}}">in thread</a>{{end}}{{end}}{{range .Reactions}}<span data-reaction="{{.Content}}">{{.Content}} {{.Count}}</span>{{end}}</footer>{{end}}6464 </room-message>{{end}}
M internal/webui/rooms_test.go +2 -2