summaryrefslogtreecommitdiff
path: root/Assistant/WebApp
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-08-06 15:00:46 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-08-06 15:00:46 -0400
commit94e92a1b5861cf6d4c636f20e847fcc79b4f43cd (patch)
tree754d8cfcdf10b9656737c25b5df8f8132e9f6f76 /Assistant/WebApp
parent40e9402fa5d96a97b6a654863626250ee1b6a17d (diff)
make alerts change tense when they finish
Diffstat (limited to 'Assistant/WebApp')
-rw-r--r--Assistant/WebApp/SideBar.hs18
1 files changed, 5 insertions, 13 deletions
diff --git a/Assistant/WebApp/SideBar.hs b/Assistant/WebApp/SideBar.hs
index 4373b5a5b..509c5fa2f 100644
--- a/Assistant/WebApp/SideBar.hs
+++ b/Assistant/WebApp/SideBar.hs
@@ -13,7 +13,7 @@ import Assistant.Common
import Assistant.WebApp
import Assistant.WebApp.Notifications
import Assistant.DaemonStatus
-import Assistant.Alert hiding (Widget)
+import Assistant.Alert
import Utility.NotificationBroadcaster
import Utility.Yesod
@@ -25,9 +25,6 @@ import Control.Concurrent
sideBarDisplay :: Widget
sideBarDisplay = do
let content = do
- {- Any yesod message appears as the first alert. -}
- maybe noop rendermessage =<< lift getMessage
-
{- Add newest alerts to the sidebar. -}
webapp <- lift getYesod
alertpairs <- M.toList . alertMap
@@ -49,17 +46,12 @@ sideBarDisplay = do
(alertClosable alert)
(alertBlockDisplay alert)
(bootstrapclass $ alertClass alert)
- (alertHeader alert)
+ (renderAlertHeader alert)
+ (renderAlertMessage alert)
(alertIcon alert)
- $ case alertMessage alert of
- StringAlert s -> [whamlet|#{s}|]
- WidgetAlert w -> w alert
- rendermessage msg = addalert firstAlertId True False
- "alert-info" Nothing (Just "exclamation-sign") [whamlet|#{msg}|]
-
- addalert :: AlertId -> Bool -> Bool -> Text -> Maybe String -> Maybe String -> Widget -> Widget
- addalert i closable block divclass heading icon widget = do
+ addalert :: AlertId -> Bool -> Bool -> Text -> Maybe Text -> Text -> Maybe String -> Widget
+ addalert i closable block divclass heading message icon = do
let alertid = show i
let closealert = CloseAlert i
$(widgetFile "sidebar/alert")