hide actions for preview until work out something better

Ted Unangst 5 years ago
parent 9b2db30f75
commit ab0eab70e0

@ -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 @@ in reply to: <a href="{{ .RID }}" rel=noreferrer>{{ .RID }}</a>
{{ end }}
</details>
{{ end }}
{{ if $bonkcsrf }}
{{ if and $bonkcsrf (not $IsPreview) }}
<p>
<details class="actions">
<summary>Actions

@ -18,8 +18,9 @@
<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>

@ -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 {

Loading…
Cancel
Save