summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Assistant/Alert.hs16
-rw-r--r--Assistant/WebApp/SideBar.hs7
-rw-r--r--static/img/glyphicons-halflings-white.pngbin0 -> 4352 bytes
-rw-r--r--static/img/glyphicons-halflings.pngbin0 -> 4352 bytes
-rw-r--r--templates/documentation/about.hamlet3
-rw-r--r--templates/sidebar/alert.hamlet4
6 files changed, 14 insertions, 16 deletions
diff --git a/Assistant/Alert.hs b/Assistant/Alert.hs
index 9a0bba8ae..0412dfe51 100644
--- a/Assistant/Alert.hs
+++ b/Assistant/Alert.hs
@@ -34,6 +34,7 @@ data Alert = Alert
, alertBlockDisplay :: Bool
, alertClosable :: Bool
, alertPriority :: AlertPriority
+ , alertIcon :: Maybe String
}
type AlertPair = (AlertId, Alert)
@@ -108,26 +109,15 @@ makeAlertFiller success alert
| otherwise = alert
{ alertClass = if c == Activity then c' else c
, alertPriority = Filler
- , alertHeader = finished <$> h
- , alertMessage = massage m
, alertClosable = True
+ , alertIcon = Just $ if success then "ok" else "exclamation-sign"
}
where
- h = alertHeader alert
- m = alertMessage alert
c = alertClass alert
c'
| success = Success
| otherwise = Error
- massage (WidgetAlert w) = WidgetAlert w -- renders old on its own
- massage (StringAlert s) = StringAlert $
- maybe (finished s) (const s) h
-
- finished s
- | success = s ++ ": Ok"
- | otherwise = s ++ ": Failed"
-
isFiller :: Alert -> Bool
isFiller alert = alertPriority alert == Filler
@@ -163,6 +153,7 @@ baseActivityAlert = Alert
, alertBlockDisplay = False
, alertClosable = False
, alertPriority = Medium
+ , alertIcon = Just "refresh"
}
activityAlert :: Maybe String -> String -> Alert
@@ -220,4 +211,5 @@ sanityCheckFixAlert msg = Alert
, alertBlockDisplay = True
, alertPriority = High
, alertClosable = True
+ , alertIcon = Just "exclamation-sign"
}
diff --git a/Assistant/WebApp/SideBar.hs b/Assistant/WebApp/SideBar.hs
index 2c630324c..a4b837897 100644
--- a/Assistant/WebApp/SideBar.hs
+++ b/Assistant/WebApp/SideBar.hs
@@ -49,15 +49,16 @@ sideBarDisplay = do
(alertBlockDisplay alert)
(bootstrapclass $ alertClass alert)
(alertHeader alert)
+ (alertIcon alert)
$ case alertMessage alert of
StringAlert s -> [whamlet|#{s}|]
WidgetAlert w -> w alert
rendermessage msg = addalert firstAlertId True False
- "alert-info" Nothing [whamlet|#{msg}|]
+ "alert-info" Nothing (Just "exclamation-sign") [whamlet|#{msg}|]
- addalert :: AlertId -> Bool -> Bool -> Text -> Maybe String -> Widget -> Widget
- addalert i closable block divclass heading widget = do
+ addalert :: AlertId -> Bool -> Bool -> Text -> Maybe String -> Maybe String -> Widget -> Widget
+ addalert i closable block divclass heading icon widget = do
let alertid = show i
let closealert = CloseAlert i
$(widgetFile "sidebar/alert")
diff --git a/static/img/glyphicons-halflings-white.png b/static/img/glyphicons-halflings-white.png
new file mode 100644
index 000000000..a20760bfd
--- /dev/null
+++ b/static/img/glyphicons-halflings-white.png
Binary files differ
diff --git a/static/img/glyphicons-halflings.png b/static/img/glyphicons-halflings.png
new file mode 100644
index 000000000..92d4445df
--- /dev/null
+++ b/static/img/glyphicons-halflings.png
Binary files differ
diff --git a/templates/documentation/about.hamlet b/templates/documentation/about.hamlet
index 6236fb22c..af48a0b10 100644
--- a/templates/documentation/about.hamlet
+++ b/templates/documentation/about.hamlet
@@ -10,7 +10,8 @@
<hr>
git-annex is © 2010-2012 Joey Hess. It is free software, licensed #
under the terms of the GNU General Public License, version 3 or above. #
- Its development was made possible by #
+ <br>
+ <i class="icon-heart"></i> Its development was made possible by #
<a href="http://git-annex.branchable.com/design/assistant/thanks/">
many excellent people
.
diff --git a/templates/sidebar/alert.hamlet b/templates/sidebar/alert.hamlet
index 8fa77eac1..84126c381 100644
--- a/templates/sidebar/alert.hamlet
+++ b/templates/sidebar/alert.hamlet
@@ -1,6 +1,10 @@
<div .alert .fade .in .#{divclass} :block:.alert-block ##{alertid} :closable:onclick="(function( $ ) { $.get('@{closealert}') })( jQuery );">
$if closable
<a .close data-dismiss="alert">&times;</a>
+ $case icon
+ $of Nothing
+ $of Just name
+ <i class="icon-#{name}"></i> #
$maybe h <- heading
$if block
<h4 class="alert-heading">#{h}</h4>