Copyright | (c) digitally induced GmbH 2020 |
---|---|
Safe Haskell | None |
Synopsis
- setSuccessMessage :: (?context :: ControllerContext) => Text -> IO ()
- setErrorMessage :: (?context :: ControllerContext) => Text -> IO ()
- getSuccessMessage :: (?context :: ControllerContext) => IO (Maybe Text)
- clearSuccessMessage :: (?context :: ControllerContext) => IO ()
- getAndClearFlashMessages :: (?context :: ControllerContext) => IO [FlashMessage]
- successMessageKey :: ByteString
- errorMessageKey :: ByteString
- initFlashMessages :: (?context :: ControllerContext) => IO ()
Documentation
setSuccessMessage :: (?context :: ControllerContext) => Text -> IO () Source #
Sets a flash messages. This is shown to the user when the next view is rendered.
Will be rendered in a bootstrap alert, with the alert-success
styling.
Take a look at https://getbootstrap.com/docs/4.5/components/alerts/ for how this will look like.
This requires renderFlashMessages
to be placed somewhere in the layout or page of the next view.
For example:
myLayout view = [hsx| {renderFlashMessages} <main>{view}</main> |]
setErrorMessage :: (?context :: ControllerContext) => Text -> IO () Source #
Sets a flash messages. This is shown to the user when the next view is rendered.
Will be rendered in a bootstrap alert, with the alert-danger
styling.
Take a look at https://getbootstrap.com/docs/4.5/components/alerts/ for how this will look like.
This requires renderFlashMessages
to be placed somewhere in the layout or page of the next view.
For example:
myLayout view = [hsx| {renderFlashMessages} <main>{view}</main> |]
getSuccessMessage :: (?context :: ControllerContext) => IO (Maybe Text) Source #
Returns the flash message currently set
clearSuccessMessage :: (?context :: ControllerContext) => IO () Source #
Removes the current flash message
getAndClearFlashMessages :: (?context :: ControllerContext) => IO [FlashMessage] Source #
initFlashMessages :: (?context :: ControllerContext) => IO () Source #