Merge pull request #809 from dunric/master

`required' attribute for nicHtmlField (textarea tag)
This commit is contained in:
Michael Snoyman 2014-08-20 16:04:32 +03:00
commit 40547b2b71

View File

@ -26,10 +26,10 @@ class Yesod a => YesodNic a where
nicHtmlField :: YesodNic site => Field (HandlerT site IO) Html
nicHtmlField = Field
{ fieldParse = \e _ -> return . Right . fmap (preEscapedToMarkup . sanitizeBalance) . listToMaybe $ e
, fieldView = \theId name attrs val _isReq -> do
, fieldView = \theId name attrs val isReq -> do
toWidget [shamlet|
$newline never
<textarea id="#{theId}" *{attrs} name="#{name}" .html>#{showVal val}
<textarea id="#{theId}" *{attrs} name="#{name}" :isReq:required .html>#{showVal val}
|]
addScript' urlNicEdit
master <- getYesod