all repos — honk @ 31e533b9bc375f7e307d01b898f0dde25e2e33e8

my fork of honk

views/chatter.html (view raw)

 1{{ template "header.html" . }}
 2<main>
 3<div class="info">
 4<p>
 5<form action="/sendchonk" method="POST">
 6<h3>new chatter</h3>
 7<input type="hidden" name="CSRF" value="{{ .ChonkCSRF }}">
 8<p><label for=target>target:</label><br>
 9<input type="text" name="target" value="" autocomplete=off>
10<p><label for=noise>noise:</label><br>
11<textarea name="noise" id="noise"></textarea>
12<p><button name="chonk" value="chonk">chonk</button>
13</form>
14</div>
15{{ $chonkcsrf := .ChonkCSRF }}
16{{ range .Chatter }}
17<section class="honk">
18{{ $target := "" }}
19{{ range . }}
20{{ if eq $target "" }}
21{{ $target = .Target }}
22<p class="chattarget">
23chatter: {{ .Target }}
24{{ end }}
25<div class="chat">
26<p>
27<span class="chatstamp">{{ .Date.Local.Format "15:04" }} {{ .Handle }}:</span>
28{{ .HTML }}
29{{ range .Donks }}
30{{ if .Local }}
31{{ if eq .Media "text/plain" }}
32<p><a href="/d/{{ .XID }}">Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }}
33{{ else if eq .Media "application/pdf" }}
34<p><a href="/d/{{ .XID }}">Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }}
35{{ else }}
36<p><img src="/d/{{ .XID }}" title="{{ .Desc }}" alt="{{ .Desc }}">
37{{ end }}
38{{ else }}
39{{ if .XID }}
40<p><a href="{{ .URL }}" rel=noreferrer>External Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }}
41{{ else }}
42{{ if eq .Media "video/mp4" }}
43<p><video controls src="{{ .URL }}">{{ .Name }}</video>
44{{ else }}
45<p><img src="{{ .URL }}" title="{{ .Desc }}" alt="{{ .Desc }}">
46{{ end }}
47{{ end }}
48{{ end }}
49{{ end }}
50</div>
51{{ end }}
52<form action="/sendchonk" method="POST">
53<input type="hidden" name="CSRF" value="{{ $chonkcsrf }}">
54<input type="hidden" name="target" value="{{ $target }}" autocomplete=off>
55<p><label for=noise>noise:</label><br>
56<textarea name="noise" id="noise"></textarea>
57<p><button name="chonk" value="chonk">chonk</button>
58</form>
59</section>
60{{ end }}
61</main>