module Text.Reform.Hamlet.String
(
inputText
, inputPassword
, inputSubmit
, inputReset
, inputHidden
, inputButton
, inputCheckbox
, inputCheckboxes
, inputRadio
, inputFile
, textarea
, buttonSubmit
, buttonReset
, button
, select
, selectMultiple
, label
, errorList
, childErrorList
, br
, fieldset
, ol
, ul
, li
, form
) where
import Data.Text.Lazy (Text, pack)
import Text.Blaze (ToMarkup(..))
import Text.Reform
import qualified Text.Reform.Hamlet.Common as C
import Text.Hamlet (HtmlUrl)
inputText :: (Monad m, FormInput input, FormError error, ErrorInputType error ~ input) =>
String
-> Form m input error (HtmlUrl url) () String
inputText initialValue = C.inputText getInputString initialValue
inputPassword :: (Monad m, FormInput input, FormError error, ErrorInputType error ~ input) =>
Form m input error (HtmlUrl url) () String
inputPassword = C.inputPassword getInputString ""
inputSubmit :: (Monad m, FormInput input, FormError error, ErrorInputType error ~ input) =>
String
-> Form m input error (HtmlUrl url) () (Maybe String)
inputSubmit initialValue = C.inputSubmit getInputString initialValue
inputReset :: (Monad m, FormInput input, FormError error, ErrorInputType error ~ input) =>
String
-> Form m input error (HtmlUrl url) () ()
inputReset = C.inputReset
inputHidden :: (Monad m, FormInput input, FormError error, ErrorInputType error ~ input) =>
String
-> Form m input error (HtmlUrl url) () String
inputHidden initialValue = C.inputHidden getInputString initialValue
inputButton :: (Monad m, FormInput input, FormError error, ErrorInputType error ~ input) =>
String
-> Form m input error (HtmlUrl url) () ()
inputButton label = C.inputButton label
textarea :: (Monad m, FormInput input, FormError error, ErrorInputType error ~ input) =>
Int
-> Int
-> String
-> Form m input error (HtmlUrl url) () String
textarea rows cols initialValue = C.textarea getInputString rows cols initialValue
buttonSubmit :: ( Monad m, FormError error, FormInput input, ErrorInputType error ~ input, ToMarkup children) =>
String
-> children
-> Form m input error (HtmlUrl url) () (Maybe String)
buttonSubmit = C.buttonSubmit getInputString
inputCheckbox :: forall x error input m url. (Monad m, FormInput input, FormError error, ErrorInputType error ~ input) =>
Bool
-> Form m input error (HtmlUrl url) () Bool
inputCheckbox = C.inputCheckbox
inputCheckboxes :: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, ToMarkup lbl) =>
[(a, lbl)]
-> (a -> Bool)
-> Form m input error (HtmlUrl url) () [a]
inputCheckboxes = C.inputCheckboxes
inputRadio :: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, ToMarkup lbl) =>
[(a, lbl)]
-> (a -> Bool)
-> Form m input error (HtmlUrl url) () a
inputRadio = C.inputRadio
inputFile :: (Monad m, FormError error, FormInput input, ErrorInputType error ~ input) =>
Form m input error (HtmlUrl url) () (FileType input)
inputFile = C.inputFile
buttonReset :: (Monad m, FormError error, ToMarkup children) =>
children
-> Form m input error (HtmlUrl url) () ()
buttonReset = C.buttonReset
button :: ( Monad m, FormError error, FormInput input, ErrorInputType error ~ input, ToMarkup children) =>
children
-> Form m input error (HtmlUrl url) () ()
button = C.button
select :: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, ToMarkup lbl) =>
[(a, lbl)]
-> (a -> Bool)
-> Form m input error (HtmlUrl url) () a
select = C.select
selectMultiple :: (Functor m, Monad m, FormError error, ErrorInputType error ~ input, FormInput input, ToMarkup lbl) =>
[(a, lbl)]
-> (a -> Bool)
-> Form m input error (HtmlUrl url) () [a]
selectMultiple = C.selectMultiple
label :: (Monad m, ToMarkup c) =>
c
-> Form m input error (HtmlUrl url) () ()
label = C.label
errorList :: (Monad m, ToMarkup error) =>
Form m input error (HtmlUrl url) () ()
errorList = C.errorList
childErrorList :: (Monad m, ToMarkup error) =>
Form m input error (HtmlUrl url) () ()
childErrorList = C.childErrorList
br :: (Monad m) => Form m input error (HtmlUrl url) () ()
br = C.br
fieldset :: (Monad m, Functor m, ToMarkup c) =>
Form m input error c proof a
-> Form m input error (HtmlUrl url) proof a
fieldset = C.fieldset
ol :: (Monad m, Functor m, ToMarkup c) =>
Form m input error c proof a
-> Form m input error (HtmlUrl url) proof a
ol = C.ol
ul :: (Monad m, Functor m, ToMarkup c) =>
Form m input error c proof a
-> Form m input error (HtmlUrl url) proof a
ul = C.ul
li :: (Monad m, Functor m, ToMarkup c) =>
Form m input error c proof a
-> Form m input error (HtmlUrl url) proof a
li = C.li
form :: ToMarkup action =>
action
-> [(Text, Text)]
-> (HtmlUrl url)
-> (HtmlUrl url)
form = C.form