clone

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

main
tinyrelay / tinyclient / chat.html
chat.html 2.1K
1{{define "chat"}}<section id="chat">2<h1>Chat</h1>3<h2 id="new-chat">Direct chats</h2>4{{if .Actor}}<direct-start><label>Start a conversation <input name="peer" required placeholder="npub or public key" autocomplete="off" spellcheck="false"></label><button data-primary>New chat</button></direct-start>5<direct-chats actor="{{.Actor}}" relay="{{wsURL .URL}}"><p>Connect your signer to open your encrypted conversations.</p></direct-chats>6<noscript><p>Direct chats need JavaScript and a signer that supports NIP-44 encryption. Group rooms are available below.</p></noscript>7{{else}}<p><a href="{{signinURL .Base .Path .Query}}">Sign in</a> to open your direct chats.</p>{{end}}8<h2>Rooms</h2>9{{template "roomList" .}}10</section>{{end}}1112{{define "direct"}}<section id="direct-chat">13<header><h1>{{template "nostrName" .View}}</h1></header>14{{if .Actor}}<direct-thread actor="{{.Actor}}" peer="{{.View}}" relay="{{wsURL .URL}}"><p>Connect your signer to decrypt this conversation.</p></direct-thread>15<direct-compose actor="{{.Actor}}" peer="{{.View}}" relay="{{wsURL .URL}}"><label for="direct-content">Message</label><textarea id="direct-content" name="content" rows="2" required title="Enter to send; Shift+Enter for a new line" placeholder="Write a private message…"></textarea><button type="submit" data-primary>Send</button></direct-compose>16<noscript><p>Reading and sending direct messages needs JavaScript and a signer that supports NIP-44 encryption.</p></noscript>17{{else}}<p><a href="{{signinURL .Base .Path .Query}}">Sign in</a> to open this private conversation.</p>{{end}}18</section>{{end}}1920{{define "panel-chat"}}<section><h4>Direct messages</h4>{{if .Actor}}<direct-settings actor="{{.Actor}}" relay="{{wsURL .URL}}"></direct-settings><p><small>Add this relay to your message relay list.</small></p>{{end}}</section>21{{if .Actor}}<section><h4>Notifications</h4><push-toggle></push-toggle><noscript><p>Enabling notifications needs JavaScript.</p></noscript></section>{{end}}22{{if .Actor}}<section><h4>Group rooms</h4><a href="/chat#new-room">Create a room</a></section>{{end}}{{end}}