yesod-alerts: Alert messages for the Yesod framework

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Warnings:

Use the "alerts" package with the Yesod framework


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.1.0, 0.1.2.0, 0.1.3.0, 0.1.3.0
Change log None available
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 alx741 at 2019-06-28T18:16:05Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for yesod-alerts-0.1.3.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