From b85cae2241bfff7602f131cb85478b2a68cf448d Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Thu, 14 Mar 2024 20:54:58 -0400 Subject: [PATCH] Tweak to chapter edit template --- src/MyWebLog/Views/Post.fs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/MyWebLog/Views/Post.fs b/src/MyWebLog/Views/Post.fs index 36339f9..fa0de21 100644 --- a/src/MyWebLog/Views/Post.fs +++ b/src/MyWebLog/Views/Post.fs @@ -55,8 +55,7 @@ let chapterEdit (model: EditChapterModel) app = [ ] ] div [ _class "row" ] [ - let hasLoc = model.LocationName <> "" - let attrs = if hasLoc then [] else [ _disabled ] + let hasLoc, attrs = if model.LocationName = "" then false, [ _disabled ] else true, [] div [ _class "col-12 col-md-4 col-lg-3 offset-lg-1 mb-3 align-self-end" ] [ checkboxSwitch [ _onclick "Admin.checkChapterLocation()" ] "has_location" "Associate Location" hasLoc [] ] @@ -91,11 +90,7 @@ let chapterEdit (model: EditChapterModel) app = [ div [ _class "col" ] [ let cancelLink = relUrl app $"admin/post/{model.PostId}/chapters" if model.Index < 0 then - div [ _class "form-check form-switch mb-3" ] [ - input [ _type "checkbox"; _id "add_another"; _name "AddAnother"; _class "form-check-input" - _value "true"; _checked ] - label [ _for "add_another" ] [ raw "Add Another New Chapter" ] - ] + checkboxSwitch [ _checked ] (nameof model.AddAnother) "Add Another New Chapter" true [] else input [ _type "hidden"; _name "AddAnother"; _value "false" ] saveButton; raw "   "