hide actions for preview until work out something better

This commit is contained in:
Ted Unangst 2019-10-11 16:36:20 -04:00
parent ba8270e97c
commit ebe7863e75
3 changed files with 5 additions and 2 deletions

View File

@ -1,5 +1,6 @@
<article class="honk {{ .Honk.Style }}" data-convoy="{{ .Honk.Convoy }}"> <article class="honk {{ .Honk.Style }}" data-convoy="{{ .Honk.Convoy }}">
{{ $bonkcsrf := .BonkCSRF }} {{ $bonkcsrf := .BonkCSRF }}
{{ $IsPreview := .IsPreview }}
{{ with .Honk }} {{ with .Honk }}
<header> <header>
{{ if $bonkcsrf }} {{ if $bonkcsrf }}
@ -82,7 +83,7 @@ in reply to: <a href="{{ .RID }}" rel=noreferrer>{{ .RID }}</a>
{{ end }} {{ end }}
</details> </details>
{{ end }} {{ end }}
{{ if $bonkcsrf }} {{ if and $bonkcsrf (not $IsPreview) }}
<p> <p>
<details class="actions"> <details class="actions">
<summary>Actions <summary>Actions

View File

@ -18,8 +18,9 @@
<div id="honksonpage"> <div id="honksonpage">
<div> <div>
{{ $BonkCSRF := .HonkCSRF }} {{ $BonkCSRF := .HonkCSRF }}
{{ $IsPreview := .IsPreview }}
{{ range .Honks }} {{ range .Honks }}
{{ template "honk.html" map "Honk" . "BonkCSRF" $BonkCSRF }} {{ template "honk.html" map "Honk" . "BonkCSRF" $BonkCSRF "IsPreview" $IsPreview }}
{{ end }} {{ end }}
</div> </div>
</div> </div>

1
web.go
View File

@ -1194,6 +1194,7 @@ func submithonk(w http.ResponseWriter, r *http.Request) {
templinfo["InReplyTo"] = r.FormValue("rid") templinfo["InReplyTo"] = r.FormValue("rid")
templinfo["Noise"] = r.FormValue("noise") templinfo["Noise"] = r.FormValue("noise")
templinfo["SavedFile"] = donkxid templinfo["SavedFile"] = donkxid
templinfo["IsPreview"] = true
templinfo["ServerMessage"] = "honk preview" templinfo["ServerMessage"] = "honk preview"
err := readviews.Execute(w, "honkpage.html", templinfo) err := readviews.Execute(w, "honkpage.html", templinfo)
if err != nil { if err != nil {