added fiRequired :: Bool to FieldInfo
This commit is contained in:
parent
370dad86df
commit
6119f8507e
@ -160,6 +160,7 @@ requiredFieldHelper (FieldProfile parse render mkWidget) ffs orig = GForm $ do
|
|||||||
, fiErrors = case res of
|
, fiErrors = case res of
|
||||||
FormFailure [x] -> Just $ string x
|
FormFailure [x] -> Just $ string x
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
|
, fiRequired = True
|
||||||
}
|
}
|
||||||
return (res, [fi], UrlEncoded)
|
return (res, [fi], UrlEncoded)
|
||||||
|
|
||||||
@ -191,6 +192,7 @@ optionalFieldHelper (FieldProfile parse render mkWidget) ffs orig' = GForm $ do
|
|||||||
, fiErrors = case res of
|
, fiErrors = case res of
|
||||||
FormFailure x -> Just $ string $ unlines x
|
FormFailure x -> Just $ string $ unlines x
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
|
, fiRequired = False
|
||||||
}
|
}
|
||||||
return (res, [fi], UrlEncoded)
|
return (res, [fi], UrlEncoded)
|
||||||
|
|
||||||
@ -212,6 +214,7 @@ data FieldInfo sub y = FieldInfo
|
|||||||
, fiIdent :: String
|
, fiIdent :: String
|
||||||
, fiInput :: GWidget sub y ()
|
, fiInput :: GWidget sub y ()
|
||||||
, fiErrors :: Maybe Html
|
, fiErrors :: Maybe Html
|
||||||
|
, fiRequired :: Bool
|
||||||
}
|
}
|
||||||
|
|
||||||
data FormFieldSettings = FormFieldSettings
|
data FormFieldSettings = FormFieldSettings
|
||||||
|
|||||||
@ -114,6 +114,7 @@ boolField ffs orig = GForm $ do
|
|||||||
, fiErrors = case res of
|
, fiErrors = case res of
|
||||||
FormFailure [x] -> Just $ string x
|
FormFailure [x] -> Just $ string x
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
|
, fiRequired = True
|
||||||
}
|
}
|
||||||
return (res, [fi], UrlEncoded)
|
return (res, [fi], UrlEncoded)
|
||||||
|
|
||||||
@ -161,6 +162,7 @@ selectField pairs ffs initial = GForm $ do
|
|||||||
, fiErrors = case res of
|
, fiErrors = case res of
|
||||||
FormFailure [x] -> Just $ string x
|
FormFailure [x] -> Just $ string x
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
|
, fiRequired = True
|
||||||
}
|
}
|
||||||
return (res, [fi], UrlEncoded)
|
return (res, [fi], UrlEncoded)
|
||||||
|
|
||||||
@ -203,6 +205,7 @@ maybeSelectField pairs ffs initial' = GForm $ do
|
|||||||
, fiErrors = case res of
|
, fiErrors = case res of
|
||||||
FormFailure [x] -> Just $ string x
|
FormFailure [x] -> Just $ string x
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
|
, fiRequired = False
|
||||||
}
|
}
|
||||||
return (res, [fi], UrlEncoded)
|
return (res, [fi], UrlEncoded)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user