Safe Haskell | None |
---|---|
Language | Haskell2010 |
Setup this package by modifying your definition of *defaultLayout* in *Foundation.hs*
... defaultLayout widget = do ... alerts <- getAlerts ...
Then Include a renderer in *default-layout.hamlet*
... #{renderAlertsBootstrap3 alerts} ... ^{widget} ...
Set alerts from your handlers
getHomeR :: Handler Html getHomeR = do ... setAlert (Alert Error "oops") setSuccessAlert "Yay!" ... defautlLayout $ do $(widgetFile "homepage")
- setAlert :: MonadHandler m => Alert -> m ()
- setDefaultAlert :: MonadHandler m => Text -> m ()
- setInfoAlert :: MonadHandler m => Text -> m ()
- setSuccessAlert :: MonadHandler m => Text -> m ()
- setWarningAlert :: MonadHandler m => Text -> m ()
- setErrorAlert :: MonadHandler m => Text -> m ()
- getAlerts :: MonadHandler m => m [Alert]
- data Alert :: * = Alert {}
- data AlertStatus :: *
Setting alerts
setAlert :: MonadHandler m => Alert -> m () Source #
Shortcuts
setDefaultAlert :: MonadHandler m => Text -> m () Source #
setInfoAlert :: MonadHandler m => Text -> m () Source #
setSuccessAlert :: MonadHandler m => Text -> m () Source #
setWarningAlert :: MonadHandler m => Text -> m () Source #
setErrorAlert :: MonadHandler m => Text -> m () Source #
Getting alerts
getAlerts :: MonadHandler m => m [Alert] Source #