yesod-alerts-0.1.3.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 
Instances
Eq Alert 
Instance details

Defined in Web.Alert

Methods

(==) :: Alert -> Alert -> Bool #

(/=) :: Alert -> Alert -> Bool #

Read Alert 
Instance details

Defined in Web.Alert

Show Alert 
Instance details

Defined in Web.Alert

Methods

showsPrec :: Int -> Alert -> ShowS #

show :: Alert -> String #

showList :: [Alert] -> ShowS #

data AlertStatus #

Constructors

Default 
Info 
Success 
Warning 
Error 
Instances
Bounded AlertStatus 
Instance details

Defined in Web.Alert

Eq AlertStatus 
Instance details

Defined in Web.Alert

Read AlertStatus 
Instance details

Defined in Web.Alert

Show AlertStatus 
Instance details

Defined in Web.Alert