From ebe7863e751ebff0e5d6ac61b9a4880cefc2fa80 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Fri, 11 Oct 2019 16:36:20 -0400 Subject: [PATCH] hide actions for preview until work out something better --- views/honk.html | 3 ++- views/honkpage.html | 3 ++- web.go | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/views/honk.html b/views/honk.html index e745f2d..f3cdb08 100644 --- a/views/honk.html +++ b/views/honk.html @@ -1,5 +1,6 @@
{{ $bonkcsrf := .BonkCSRF }} +{{ $IsPreview := .IsPreview }} {{ with .Honk }}
{{ if $bonkcsrf }} @@ -82,7 +83,7 @@ in reply to: {{ .RID }} {{ end }} {{ end }} -{{ if $bonkcsrf }} +{{ if and $bonkcsrf (not $IsPreview) }}

Actions diff --git a/views/honkpage.html b/views/honkpage.html index 8b4b63c..5ceedd9 100644 --- a/views/honkpage.html +++ b/views/honkpage.html @@ -18,8 +18,9 @@
{{ $BonkCSRF := .HonkCSRF }} +{{ $IsPreview := .IsPreview }} {{ range .Honks }} -{{ template "honk.html" map "Honk" . "BonkCSRF" $BonkCSRF }} +{{ template "honk.html" map "Honk" . "BonkCSRF" $BonkCSRF "IsPreview" $IsPreview }} {{ end }}
diff --git a/web.go b/web.go index 6095307..bae7422 100644 --- a/web.go +++ b/web.go @@ -1194,6 +1194,7 @@ func submithonk(w http.ResponseWriter, r *http.Request) { 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 {