yesod-alerts

Alert messages for the Yesod framework https://github.com/alx741/yesod-alerts#readme

Latest on Hackage:0.1.3.0

See all snapshots yesod-alerts appears in

BSD-3-Clause licensed by Daniel Campoverde
Maintained by [email protected]

Module documentation for 0.1.2.0

This version can be pinned in stack with:[email protected]:af8087e86af741147793f25f2bc9bd281b300f59f4fbedb1e94b9219158abba9,1234

yesod-alerts

Alert messages for the Yesod framework

Setup

Modify your definition of defaultLayout in Foundation.hs:

defaultLayout widget = do
    ...
    alerts  <- getAlerts
    ...

Then Include a renderer in default-layout.hamlet

...
#{renderAlertsBootstrap3 alerts}
...
^{widget}
...

Usage

Set alerts from your handlers

getHomeR :: Handler Html
getHomeR = do
    ...
    setAlert (Alert Error "oops")
    setSuccessAlert "Yay!"
    ...
    defautlLayout $ do
        $(widgetFile "homepage")

Renderers

  • Bootstrap v3
  • Bootstrap v4
  • Foundation v5