yesod-bootstrap 0.2 → 0.2.1
raw patch · 2 files changed
+16/−2 lines, 2 files
Files
- src/Yesod/Bootstrap.hs +15/−1
- yesod-bootstrap.cabal +1/−1
src/Yesod/Bootstrap.hs view
@@ -204,6 +204,20 @@ div_ [("class","panel-body")] $ do content +textSubmitGroupGetForm :: Route site -> Context -> Size -> Text -> Text -> Text -> WidgetT site IO () -> Bool -> WidgetT site IO ()+textSubmitGroupGetForm route ctx size name placeholder value buttonContent buttonIsLeft = do+ render <- getUrlRender+ form_ [("method","GET"),("action",render route)] $ do+ div_ [("class","form-group")] $ do+ div_ [("class","input-group input-group-" <> colSizeShortName size)] + $ mconcat+ $ (if buttonIsLeft then reverse else id)+ [ input_ [("class","form-control"),("type","text"),("name",name),("placeholder",placeholder),("value",value)]+ , span_ [("class","input-group-btn")] $ do+ button_ [("class","btn btn-" <> contextName ctx)] buttonContent+ ]+ + colSizeShortName :: Size -> Text colSizeShortName s = case s of ExtraSmall -> "xs" @@ -301,7 +315,7 @@ togglableTabs :: ToggleStyle -> [ToggleTab site] -> WidgetT site IO () togglableTabs s tabs = do (nav,bodies) <- execWriterT $ forM_ (zip [1..] tabs) $ \(i,tab) -> case tab of- ToggleSection title body -> do+ ToggleSection title body -> do -- WriterT (Widget,Widget) over a WidgetT theId <- lift newIdent let tabAAttrs = [("role","tab"),("href","#" <> theId),("data-toggle","tab")] tabLiAttrs = (if isFirst then addClass "active" else id) [("role","presentation")]
yesod-bootstrap.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: yesod-bootstrap-version: 0.2+version: 0.2.1 synopsis: Bootstrap widgets for yesod -- description: license: MIT