yesod-alerts: Alert messages for the Yesod framework

[ bsd3, library, web ] [ Propose Tags ]

Use the "alerts" package with the Yesod framework


[Skip to Readme]
Versions 0.1.0.0, 0.1.1.0, 0.1.2.0
Dependencies alerts (>=0.1.0.0 && <0.2.0.0), base (>=4.7 && <5), blaze-html, blaze-markup, safe (>=0.3.14 && <0.4), text (>=0.11 && <2.0), yesod-core (>=1.4.32) [details]
License BSD-3-Clause
Copyright 2017 Daniel Campoverde
Author Daniel Campoverde
Maintainer alx@sillybytes.net
Category Web
Home page https://github.com/alx741/yesod-alerts#readme
Source repo head: git clone https://github.com/alx741/yesod-alerts
Uploaded by DanielCampoverde at Thu Feb 22 21:49:24 UTC 2018
Distributions LTSHaskell:0.1.2.0, NixOS:0.1.2.0, Stackage:0.1.2.0, openSUSE:0.1.2.0
Downloads 369 total (12 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-02-22 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for yesod-alerts-0.1.2.0

[back to package description]

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