when omit images, include a link
Ted Unangst tedu@tedunangst.com
Fri, 08 May 2020 16:15:06 -0400
4 files changed,
9 insertions(+),
4 deletions(-)
M
docs/changelog.txt
→
docs/changelog.txt
@@ -2,6 +2,8 @@ changelog
=== next ++ Much better omit images handling. + + Fix update activity. + A few API refinements and additions.
M
views/honk.html
→
views/honk.html
@@ -2,6 +2,7 @@ <article class="honk {{ .Honk.Style }}" data-convoy="{{ .Honk.Convoy }}">
{{ $bonkcsrf := .BonkCSRF }} {{ $IsPreview := .IsPreview }} {{ $maplink := .MapLink }} +{{ $omitimages := .OmitImages }} {{ with .Honk }} <header> {{ if $bonkcsrf }}@@ -70,7 +71,11 @@ <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 }} +{{ if $omitimages }} +<p><a href="/d/{{ .XID }}">Image: {{ .Name }}</a>{{ if not (eq .Desc .Name) }} {{ .Desc }}{{ end }} +{{ else }} <p><img src="/d/{{ .XID }}" title="{{ .Desc }}" alt="{{ .Desc }}"> +{{ end }} {{ end }} {{ else }} {{ if .XID }}
M
views/honkpage.html
→
views/honkpage.html
@@ -35,8 +35,9 @@ {{ $BonkCSRF := .HonkCSRF }}
{{ $IsPreview := .IsPreview }} {{ $MapLink := .MapLink }} {{ $Badonk := .User.Options.Reaction }} +{{ $OmitImages := .User.Options.OmitImages }} {{ range .Honks }} -{{ template "honk.html" map "Honk" . "MapLink" $MapLink "BonkCSRF" $BonkCSRF "IsPreview" $IsPreview "Badonk" $Badonk }} +{{ template "honk.html" map "Honk" . "MapLink" $MapLink "BonkCSRF" $BonkCSRF "IsPreview" $IsPreview "Badonk" $Badonk "OmitImages" $OmitImages }} {{ end }} </div> </div>