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 ()
- setAlertI :: (MonadHandler m, RenderMessage (HandlerSite m) msg) => AlertStatus -> msg -> 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
setAlertI :: (MonadHandler m, RenderMessage (HandlerSite m) msg) => AlertStatus -> msg -> m () Source #
Set an Alert
allowing i18n
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 #