all repos — honk @ 738e98627cfb7447e09f6ded55d662d2513bf98a

my fork of honk

show chatter attachments
Ted Unangst tedu@tedunangst.com
Thu, 14 May 2020 23:58:49 -0400
commit

738e98627cfb7447e09f6ded55d662d2513bf98a

parent

ff8709373ed3c70788db8bd0304961a5f11f6045

1 files changed, 21 insertions(+), 0 deletions(-)

jump to
M views/chatter.htmlviews/chatter.html

@@ -26,6 +26,27 @@ <div class="chat">

<p> <span class="chatstamp">{{ .Date.Local.Format "15:04" }} {{ .Handle }}:</span> {{ .HTML }} +{{ range .Donks }} +{{ if .Local }} +{{ if eq .Media "text/plain" }} +<p><a href="/d/{{ .XID }}">Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }} +{{ else if eq .Media "application/pdf" }} +<p><a href="/d/{{ .XID }}">Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }} +{{ else }} +<p><img src="/d/{{ .XID }}" title="{{ .Desc }}" alt="{{ .Desc }}"> +{{ end }} +{{ else }} +{{ if .XID }} +<p><a href="{{ .URL }}" rel=noreferrer>External Attachment: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }} +{{ else }} +{{ if eq .Media "video/mp4" }} +<p><video controls src="{{ .URL }}">{{ .Name }}</video> +{{ else }} +<p><img src="{{ .URL }}" title="{{ .Desc }}" alt="{{ .Desc }}"> +{{ end }} +{{ end }} +{{ end }} +{{ end }} </div> {{ end }} <form action="/sendchonk" method="POST">