AlertMessageLabels-ProposalOnly

This commit is contained in:
SJost 2018-09-24 19:00:40 +02:00
parent 4d96504fe7
commit 9bb7f3a904

View File

@ -1,9 +1,13 @@
{-# LANGUAGE CPP #-}
{- # LANGUAGE FlexibleInstances, FlexibleContexts #-}
{- # LANGUAGE OverloadedStrings #-}
module Import.NoFoundation
( module Import
, addMessage, addMessageI
) where
import ClassyPrelude.Yesod as Import hiding (formatTime, derivePersistFieldJSON)
import ClassyPrelude.Yesod as Import hiding (formatTime, derivePersistFieldJSON) -- , addMessage, addMessageI)
-- import qualified ClassyPrelude.Yesod (addMessage, addMessageI)
import Model as Import
import Model.Types.JSON as Import
import Model.Migration as Import
@ -25,3 +29,26 @@ import Text.Lucius as Import
import Text.Shakespeare.Text as Import hiding (text, stext)
import Data.Universe as Import
{-
data MessageClass = Danger | Warning | Info
deriving (Eq,Ord,Enum,Bounded)
instance PathPiece MessageClass where
toPathPiece Danger = "danger"
toPathPiece Warning = "warning"
toPathPiece Info = "info"
-- fromPathPiece = finiteFromPathPiece -- not available here
fromPathPiece "danger" = Just Danger
fromPathPiece "warning" = Just Warning
fromPathPiece "info" = Just Info
fromPathPiece _ = Nothing
addMessage :: MonadHandler m => MessageClass-> Html -> m ()
addMessage mc = ClassyPrelude.Yesod.addMessage (toPathPiece mc)
addMessageI :: (MonadHandler m, RenderMessage (HandlerSite m) msg) => MessageClass -> msg -> m ()
addMessageI mc = ClassyPrelude.Yesod.addMessageI (toPathPiece mc)
-}