From 8a992bcef5d4426b835a3afaca9dbe1c1085a745 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 27 Oct 2012 11:24:35 -0400 Subject: add an icon for The Cloud I am befuddled that Twitter Bootstrap has no built-in Icon for The Cloud, and also that Chromium's depiction of CLOUD (U+2601) has an uncanny resemblance to PILE OF POO (U+1F4A9) when rendered small, and looks like a looming Frankenstorm when rendered large, and not a sweet, sunny, nothing can go wrong The Cloud. So, I must resort to irony in my choice of icons. --- Assistant/Alert.hs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'Assistant/Alert.hs') diff --git a/Assistant/Alert.hs b/Assistant/Alert.hs index f11ad8f58..d873d21c7 100644 --- a/Assistant/Alert.hs +++ b/Assistant/Alert.hs @@ -18,6 +18,7 @@ import qualified Data.Text as T import Data.Text (Text) import qualified Data.Map as M import Data.String +import Text.Blaze {- Different classes of alerts are displayed differently. -} data AlertClass = Success | Message | Activity | Warning | Error @@ -53,13 +54,18 @@ data Alert = Alert , alertButton :: Maybe AlertButton } -data AlertIcon = ActivityIcon | SuccessIcon | ErrorIcon | InfoIcon +data AlertIcon = ActivityIcon | SuccessIcon | ErrorIcon | InfoIcon | TheCloud -bootstrapIcon :: AlertIcon -> String -bootstrapIcon ActivityIcon = "refresh" -bootstrapIcon InfoIcon = "info-sign" -bootstrapIcon SuccessIcon = "ok" -bootstrapIcon ErrorIcon = "exclamation-sign" +htmlIcon :: AlertIcon -> Html +htmlIcon ActivityIcon = bootStrapIcon "refresh" +htmlIcon InfoIcon = bootStrapIcon "info-sign" +htmlIcon SuccessIcon = bootStrapIcon "ok" +htmlIcon ErrorIcon = bootStrapIcon "exclamation-sign" +-- utf-8 umbrella (utf-8 cloud looks too stormy) +htmlIcon TheCloud = preEscapedText "☂" + +bootStrapIcon :: Text -> Html +bootStrapIcon s = preEscapedText $ T.concat [""] {- When clicked, a button always redirects to a URL - It may also run an IO action in the background, which is useful -- cgit v1.2.3