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 != "" {
ch.Handle = short
} else {
_, ch.Handle = handles(ch.Who)
ch.Handle, _ = handles(ch.Who)
}
}

View File

@ -15,10 +15,22 @@
{{ $chonkcsrf := .ChonkCSRF }}
{{ range .Chatter }}
<section class="honk">
{{ $target := "" }}
{{ range . }}
{{ if eq $target "" }}
{{ $target = .Target }}
<p>chatter: {{ .Target }}
{{ end }}
<p>
{{ .Handle }}: {{ .HTML }}
{{ 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>
{{ end }}
</main>