yesod-alerts-0.1.1.0: Alert messages for the Yesod framework

Safe HaskellNone
LanguageHaskell2010

Yesod.Alert

Contents

Description

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")

Synopsis

Setting alerts

setAlert :: MonadHandler m => Alert -> m () Source #

Set an Alert

setAlertI :: (MonadHandler m, RenderMessage (HandlerSite m) msg) => AlertStatus -> msg -> m () Source #

Set an Alert allowing i18n

Shortcuts

Getting alerts

getAlerts :: MonadHandler m => m [Alert] Source #

Get available Alerts

data Alert :: * #

Constructors

Alert