all repos — honk @ e18c74cd26ba9bbf5a397e5da7b476b2992dbe8f

my fork of honk

when omit images, include a link
Ted Unangst tedu@tedunangst.com
Fri, 08 May 2020 16:15:06 -0400
commit

e18c74cd26ba9bbf5a397e5da7b476b2992dbe8f

parent

f2c8378d3a59920db7bf35fa3c182c2529db70ed

4 files changed, 9 insertions(+), 4 deletions(-)

jump to
M docs/changelog.txtdocs/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.htmlviews/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.htmlviews/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>
M web.goweb.go

@@ -59,9 +59,6 @@ css := template.CSS("")

if user.Options.SkinnyCSS { css += "main { max-width: 700px; }\n" } - if user.Options.OmitImages { - css += ".honk .noise img { display: none; }\n" - } return css }