yesodweb/yesod — Issue #212: Function renderBootstrap
Author: meteficha
Created: 2012-01-11 12:22:25+00:00
State: open

Hello!

Bootstrap is that CSS template by Twitter. `renderBootstrap` is like `renderDivs`, but uses the structure that Bootstrap expects. I don't know if this is useful enough to be included on `yesod-forms`, hence the issue and not a pull request =).

```haskell
-- | Render a form using Bootstrap-friendly HTML syntax. Based
-- on 'renderDivs'.
renderBootstrap :: FormRender sub master a
renderBootstrap aform fragment = do
(res, views') <- aFormToForm aform
let views = views' []
has (Just _) = True
has Nothing = False
let widget = [whamlet|
\#{fragment}
$forall view <- views

#{fvLabel view}

^{fvInput view}
$maybe tt <- fvTooltip view
#{tt}
$maybe err <- fvErrors view
#{err}
|]
return (res, widget)
```

What do you think?