25 lines
586 B
Haskell
25 lines
586 B
Haskell
{- git-annex assistant alerts
|
|
-
|
|
- Copyright 2012 Joey Hess <joey@kitenet.net>
|
|
-
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
-}
|
|
|
|
{-# LANGUAGE RankNTypes #-}
|
|
|
|
module Assistant.Alert where
|
|
|
|
import Yesod
|
|
|
|
type Widget = forall sub master. GWidget sub master ()
|
|
|
|
{- Different classes of alerts are displayed differently. -}
|
|
data AlertClass = Activity | Warning | Error | Message
|
|
|
|
{- An alert can be a simple message, or a Yesod Widget -}
|
|
data AlertMessage = StringAlert String | WidgetAlert Widget
|
|
|
|
data Alert = Alert
|
|
{ alertClass :: AlertClass
|
|
, alertMessage :: AlertMessage
|
|
}
|