all repos — honk @ e5e0a306fa1dfbcfb10c586cac46085ec94b02b3

my fork of honk

hide actions for preview until work out something better
Ted Unangst tedu@tedunangst.com
Fri, 11 Oct 2019 16:36:20 -0400
commit

e5e0a306fa1dfbcfb10c586cac46085ec94b02b3

parent

27931774809051fb985782e0271da58e3911c851

3 files changed, 5 insertions(+), 2 deletions(-)

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

@@ -1,5 +1,6 @@

<article class="honk {{ .Honk.Style }}" data-convoy="{{ .Honk.Convoy }}"> {{ $bonkcsrf := .BonkCSRF }} +{{ $IsPreview := .IsPreview }} {{ with .Honk }} <header> {{ if $bonkcsrf }}

@@ -82,7 +83,7 @@ {{ end }}

{{ end }} </details> {{ end }} -{{ if $bonkcsrf }} +{{ if and $bonkcsrf (not $IsPreview) }} <p> <details class="actions"> <summary>Actions
M views/honkpage.htmlviews/honkpage.html

@@ -18,8 +18,9 @@ {{ end }}

<div id="honksonpage"> <div> {{ $BonkCSRF := .HonkCSRF }} +{{ $IsPreview := .IsPreview }} {{ range .Honks }} -{{ template "honk.html" map "Honk" . "BonkCSRF" $BonkCSRF }} +{{ template "honk.html" map "Honk" . "BonkCSRF" $BonkCSRF "IsPreview" $IsPreview }} {{ end }} </div> </div>
M web.goweb.go

@@ -1194,6 +1194,7 @@ templinfo["Honks"] = honks

templinfo["InReplyTo"] = r.FormValue("rid") templinfo["Noise"] = r.FormValue("noise") templinfo["SavedFile"] = donkxid + templinfo["IsPreview"] = true templinfo["ServerMessage"] = "honk preview" err := readviews.Execute(w, "honkpage.html", templinfo) if err != nil {