required/optional css class for fieldsToTable

This commit is contained in:
Michael Snoyman 2010-10-15 11:31:09 +02:00
parent 6119f8507e
commit c242af6d0e

View File

@ -65,7 +65,7 @@ fieldsToTable = mapFormXml $ mapM_ go
where where
go fi = do go fi = do
wrapWidget (fiInput fi) $ \w -> [$hamlet| wrapWidget (fiInput fi) $ \w -> [$hamlet|
%tr %tr.$clazz.fi$
%td %td
%label!for=$fiIdent.fi$ $fiLabel.fi$ %label!for=$fiIdent.fi$ $fiLabel.fi$
.tooltip $fiTooltip.fi$ .tooltip $fiTooltip.fi$
@ -74,6 +74,7 @@ fieldsToTable = mapFormXml $ mapM_ go
$maybe fiErrors.fi err $maybe fiErrors.fi err
%td.errors $err$ %td.errors $err$
|] |]
clazz fi = if fiRequired fi then "required" else "optional"
runFormGeneric :: Env runFormGeneric :: Env
-> FileEnv -> FileEnv