yesod-alerts

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

Stackage Nightly 2017-12-10:0.1.1.0
Latest on Hackage:0.1.1.0
BSD3 licensed by Daniel Campoverde
Maintained by alx@sillybytes.net

Module documentation for 0.1.1.0

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
Depends on 7 packages:
comments powered byDisqus