chat backs

This commit is contained in:
Ted Unangst 2020-05-13 18:05:38 -04:00
parent 43208dcf51
commit afcbbd8d75
2 changed files with 13 additions and 1 deletions

2
fun.go
View File

@ -190,7 +190,7 @@ func filterchonk(ch *Chonk) {
if short := shortname(ch.UserID, ch.Who); short != "" { if short := shortname(ch.UserID, ch.Who); short != "" {
ch.Handle = short ch.Handle = short
} else { } else {
_, ch.Handle = handles(ch.Who) ch.Handle, _ = handles(ch.Who)
} }
} }

View File

@ -15,10 +15,22 @@
{{ $chonkcsrf := .ChonkCSRF }} {{ $chonkcsrf := .ChonkCSRF }}
{{ range .Chatter }} {{ range .Chatter }}
<section class="honk"> <section class="honk">
{{ $target := "" }}
{{ range . }} {{ range . }}
{{ if eq $target "" }}
{{ $target = .Target }}
<p>chatter: {{ .Target }}
{{ end }}
<p> <p>
{{ .Handle }}: {{ .HTML }} {{ .Handle }}: {{ .HTML }}
{{ end }} {{ end }}
<form action="/sendchonk" method="POST">
<input type="hidden" name="CSRF" value="{{ $chonkcsrf }}">
<input type="hidden" name="target" value="{{ $target }}" autocomplete=off>
<p><label for=noise>noise:</label><br>
<textarea name="noise" id="noise"></textarea>
<p><button name="chonk" value="chonk">chonk</button>
</form>
</section> </section>
{{ end }} {{ end }}
</main> </main>