show chatter attachments

This commit is contained in:
Ted Unangst 2020-05-14 23:58:49 -04:00
parent 2eda7a4e6b
commit 164a295401
1 changed files with 21 additions and 0 deletions

View File

@ -26,6 +26,27 @@ chatter: {{ .Target }}
<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">