AlertMessageLabels-ProposalOnly
This commit is contained in:
parent
4d96504fe7
commit
9bb7f3a904
@ -1,9 +1,13 @@
|
|||||||
{-# LANGUAGE CPP #-}
|
{-# LANGUAGE CPP #-}
|
||||||
|
{- # LANGUAGE FlexibleInstances, FlexibleContexts #-}
|
||||||
|
{- # LANGUAGE OverloadedStrings #-}
|
||||||
module Import.NoFoundation
|
module Import.NoFoundation
|
||||||
( module Import
|
( module Import
|
||||||
|
, addMessage, addMessageI
|
||||||
) where
|
) 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 as Import
|
||||||
import Model.Types.JSON as Import
|
import Model.Types.JSON as Import
|
||||||
import Model.Migration 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 Text.Shakespeare.Text as Import hiding (text, stext)
|
||||||
|
|
||||||
import Data.Universe as Import
|
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)
|
||||||
|
|
||||||
|
-}
|
||||||
|
|||||||
Reference in New Issue
Block a user