diff --git a/src/Handler/Utils/Form.hs b/src/Handler/Utils/Form.hs index bb434e935..4e0102360 100644 --- a/src/Handler/Utils/Form.hs +++ b/src/Handler/Utils/Form.hs @@ -39,7 +39,8 @@ import Control.Monad.Writer.Class import Data.Scientific (Scientific) import Data.Ratio import Text.Read (readMaybe) -import Text.Blaze (ToMarkup,preEscapedText) +import Text.Blaze (ToMarkup) +import Text.Hamlet (shamletFile) import Utils.Lens @@ -640,19 +641,21 @@ infoField txt = Field { fieldEnctype = UrlEncoded , fieldView = \_theId _name _attrs _val _isReq -> [whamlet|#{txt}|] } -aformSection :: (Monad m) => Text -> AForm m () -aformSection = formToAForm . formSection +aformSection :: (Monad m, ToMarkup t) => t -> AForm m () +aformSection = formToAForm . fmap (second pure) . formSection -formSection :: (Monad m) => Text -> MForm m (FormResult (), [FieldView site]) -- TODO: WIP, delete -formSection infoText = return (FormSuccess (), [infoView]) +formSection :: (Monad m, ToMarkup t) => t -> MForm m (FormResult (), FieldView site) -- TODO: WIP, delete +formSection formSectionTitle = return (FormSuccess (), infoView) where + flabel :: Html + flabel = $(shamletFile "./templates/widgets/form-section-title.shamlet") -- TODO: Why must this be fully qualified? infoView = FieldView - { fvLabel = preEscapedText $ "