diff --git a/src/Utils/Form.hs b/src/Utils/Form.hs index 17a0f362f..0391faea1 100644 --- a/src/Utils/Form.hs +++ b/src/Utils/Form.hs @@ -430,20 +430,18 @@ optionsFinite = do -- Special Forms -- ------------------- -aformSection' :: (MonadHandler m, site ~ HandlerSite m, RenderMessage site FormMessage) => SomeMessage site -> AForm m () +-- | Alternative implementation for 'aformSection' in a more standard that +-- allows tooltips and arbitrary attributs. Section header must be given through `fsLabel` +aformSection' :: (MonadHandler m, site ~ HandlerSite m, RenderMessage site FormMessage) => FieldSettings site -> AForm m () aformSection' = formToAForm . fmap (second pure) . formSection' --- | Alternative implementation for 'formSection' in a more standard that shows how allows tooltips and attributs -formSection' :: (MonadHandler m, site ~ HandlerSite m, RenderMessage site FormMessage) => SomeMessage site -> MForm m (FormResult (), FieldView site) -- TODO: WIP, delete -formSection' formSectionTitle = mreq noinputField sectionSettings Nothing +-- | Alternative implementation for 'formSection' in a more standard that +-- allows tooltips and arbitrary attributs. Section header must be given through `fsLabel` +formSection' :: (MonadHandler m, site ~ HandlerSite m, RenderMessage site FormMessage) => + FieldSettings site -> MForm m (FormResult (), FieldView site) -- TODO: WIP, delete +formSection' formSectionTitleSettings = mreq noinputField sectionSettings Nothing where - sectionSettings = FieldSettings - { fsLabel = formSectionTitle - , fsTooltip = Nothing - , fsId = Just idFormSectionNoinput - , fsName = Nothing - , fsAttrs = [("class",idFormSectionNoinput)] -- TODO: check if this it useful at all - } + sectionSettings = formSectionTitleSettings { fsId = Just idFormSectionNoinput }