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)
pull/110/head
Matt Baer 6 years ago
parent 2fdd58387a
commit b9b41b1ef7
  1. 7
      posts.go
  2. 1
      templates/edit-meta.tmpl

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

@ -263,6 +263,7 @@
</dd>
<dt>&nbsp;</dt><dd><input type="submit" value="Save changes" /></dd>
</dl>
<input type="hidden" name="web" value="true" />
</form>
</div>

Loading…
Cancel
Save