-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Template and widgets for Bootstrap2 to use with Text.Blaze.Html5 -- -- Template and widgets for Bootstrap2 to use with Text.Blaze.Html5. -- Package provides some shortcuts to hide classes and structure required -- for correct styling of elements and focus on a structure. Since -- Blaze.Html is used mostly with HappStack package provides some basic -- form processing (and dependencies). @package layout-bootstrap @version 0.2.2 -- | Wrap your Html in bootstrap-styled containers. module Layout.Bootstrap.Widgets -- | Form wrapper. form :: Text -> Text -> Html -> Html -- | Bootstrap-horizontal form. formH :: Text -> Html -> Html -- | Bootstrap-vertical form. formV :: Text -> Html -> Html -- | Fieldset label. fieldset :: Text -> Html -> Html -- | Form button bar. formActions :: Html -> Html -- | Form field for one-line text entry. data Input Input :: !Text -> !Text -> !Text -> !Text -> !Bool -> Input title :: Input -> !Text placeholder :: Input -> !Text help :: Input -> !Text value :: Input -> !Text errors :: Input -> !Bool -- | Text field with only name provided. Good to start with record -- overrides. Needs toHtml when inserted into Html tree. simpleInput :: Text -> Input -- | Html constructor for just needed parameters. input :: Text -> Text -> Text -> Html -- | Html constructor for all Input parameters. input' :: Text -> Text -> Text -> Text -> Bool -> Html -- | Generic button element. Provide list of css classes to be added. Hook -- JS actions to class names. button :: Text -> [Text] -> Html -> Html -- | Button container. Put buttons inside. buttonGroup :: Html -> Html -- | Toolbar-like groups of buttons. Put buttonGroups inside. buttonBar :: Html -> Html -- | Button with a dropdown menu. buttonDD :: Text -> Html -> Html -- | More menu-like button. Has a caret in a split section. buttonSDD :: Text -> Html -> Html -- | ID-marked navigation section. section :: Text -> Html -> Html -- | Fixed-width container. row :: Html -> Html -- | Percent-width container. rowF :: Html -> Html -- | Content wrapper to place inside a container. span :: Int -> Html -> Html -- | Cell with an offset (fixed row only). offspan :: Int -> Int -> Html -> Html -- | Dedicated place for some great quotes. blockQuote_ :: Text -> Text -> Html -> Html -- | Default glyphs. icon :: Text -> Html -- | White glyphs. iconW :: Text -> Html -- | An area with a rounded border. well :: Html -> Html -- | Tiny cross element for notification blocks. closeIcon :: Html instance Show Input instance ToHtml Input -- | Generic form builder and processor. Not-so bootstrap, but uses it's -- widgets. -- -- Example form: -- --
-- checkForm = (emptyForm []) { required = [ textField "Service" "test:pass" "Service ID. For example: «test:pass»."
-- , textField "Account" "9999995000" "Account ID. For example: «5077322496»." ]
-- , optional = [ textField "Amount" "0.12" "Amount to check." ]
--
module Layout.Bootstrap.Forms
type FormData = Map Text [Text]
-- | Form container
data Form
Form :: [Input] -> [Input] -> [Input] -> FormData -> FormData -> Form
required :: Form -> [Input]
optional :: Form -> [Input]
extra :: Form -> [Input]
formValues :: Form -> FormData
formErrors :: Form -> FormData
-- | Very basic form. You can add fancy required/optional fields with
-- record modifiers or generate simple textfields from a list of names.
emptyForm :: [Text] -> Form
-- | Text field builder to be used with Form constructor.
textField :: Text -> Text -> Text -> Input
instance Show Form
instance ToHtml Form
-- | Bootstrap-starter template. Not a real thing yet.
module Layout.Bootstrap.Starter
-- | Template configuration goes here.
type Context = Map Text Text
-- | Render a basic html wrapper wich loads styles and js.
template :: Context -> Html -> Html