all repos — honk @ 25b590d8113aea735e25e2b2764074cea44e6e6a

my fork of honk

views/chatter.html (view raw)

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