diff options
author | Joey Hess <joey@kitenet.net> | 2012-08-06 15:00:46 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-08-06 15:00:46 -0400 |
commit | 94e92a1b5861cf6d4c636f20e847fcc79b4f43cd (patch) | |
tree | 754d8cfcdf10b9656737c25b5df8f8132e9f6f76 /Assistant/WebApp/SideBar.hs | |
parent | 40e9402fa5d96a97b6a654863626250ee1b6a17d (diff) |
make alerts change tense when they finish
Diffstat (limited to 'Assistant/WebApp/SideBar.hs')
-rw-r--r-- | Assistant/WebApp/SideBar.hs | 18 |
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") |