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 {