From b9b41b1ef7279b1f24c7d0866df836976ef23bc5 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Sat, 18 May 2019 23:16:42 -0400 Subject: [PATCH] Enable un-setting RTL setting via web Previously, once RTL was enabled on a post, you couldn't unset it via the web application. This fixes that. (Fixes #103) --- posts.go | 7 ++++++- templates/edit-meta.tmpl | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/posts.go b/posts.go index b21588c..e4cc81b 100644 --- a/posts.go +++ b/posts.go @@ -67,7 +67,8 @@ type ( } AuthenticatedPost struct { - ID string `json:"id" schema:"id"` + ID string `json:"id" schema:"id"` + Web bool `json:"web" schema:"web"` *SubmittedPost } @@ -623,6 +624,10 @@ func existingPost(app *app, w http.ResponseWriter, r *http.Request) error { } } + if p.Web { + p.IsRTL.Valid = true + } + if p.SubmittedPost == nil { return ErrPostNoUpdatableVals } diff --git a/templates/edit-meta.tmpl b/templates/edit-meta.tmpl index 5d2bf1a..108c552 100644 --- a/templates/edit-meta.tmpl +++ b/templates/edit-meta.tmpl @@ -263,6 +263,7 @@
 
+