From 280de8686549eb29d9c55969447b94052873cb1a Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Tue, 30 Nov 2021 20:02:49 +0100 Subject: [PATCH] style: add inactive message style --- frontend/src/app.sass | 8 ++++++++ messages/uniworx/utils/utils/de-de-formal.msg | 1 + messages/uniworx/utils/utils/en-eu.msg | 1 + src/Utils/Frontend/Notification.hs | 9 +++++---- src/Utils/Icon.hs | 2 ++ src/Utils/Message.hs | 4 ++-- 6 files changed, 19 insertions(+), 6 deletions(-) diff --git a/frontend/src/app.sass b/frontend/src/app.sass index 8665aad07..fe1160511 100644 --- a/frontend/src/app.sass +++ b/frontend/src/app.sass @@ -10,6 +10,8 @@ --color-success-dark: #1ca64c --color-info: #c4c4c4 --color-info-dark: #919191 + --color-nonactive: #efefef + --color-nonactive-dark: #9a989e --color-lightblack: #1A2A36 --color-lightwhite: #fcfffa --color-grey: #B1B5C0 @@ -740,6 +742,9 @@ section .notification-success color: var(--color-success-dark) +.notification-nonactive + color: var(--color-nonactive) + // "Heated" element. // Set custom property "--hotness" to a value from 0 to 1 to turn // the element's background to a color on a gradient from green to red. @@ -1476,6 +1481,9 @@ a.breadcrumbs__home &--success border-left-color: var(--color-success) + + &--disabled + border-left-color: var(--color-nonactive) .active-allocations__wrapper diff --git a/messages/uniworx/utils/utils/de-de-formal.msg b/messages/uniworx/utils/utils/de-de-formal.msg index 1464f36ae..06cc8c861 100644 --- a/messages/uniworx/utils/utils/de-de-formal.msg +++ b/messages/uniworx/utils/utils/de-de-formal.msg @@ -133,6 +133,7 @@ MessageError: Fehler MessageWarning: Warnung MessageInfo !ident-ok: Information MessageSuccess: Erfolg +MessageNonactive: Inaktiv ShortFieldPrimary: HF ShortFieldSecondary: NF SheetGradingPassPoints': Bestehen nach Punkten diff --git a/messages/uniworx/utils/utils/en-eu.msg b/messages/uniworx/utils/utils/en-eu.msg index 1539fdf4c..41938f486 100644 --- a/messages/uniworx/utils/utils/en-eu.msg +++ b/messages/uniworx/utils/utils/en-eu.msg @@ -133,6 +133,7 @@ MessageError: Error MessageWarning: Warning MessageInfo: Information MessageSuccess: Success +MessageNonactive: Inactive ShortFieldPrimary: Mj ShortFieldSecondary: Mn SheetGradingPassPoints': Passing by points diff --git a/src/Utils/Frontend/Notification.hs b/src/Utils/Frontend/Notification.hs index d4ec0758a..395bbf144 100644 --- a/src/Utils/Frontend/Notification.hs +++ b/src/Utils/Frontend/Notification.hs @@ -30,10 +30,11 @@ notification nType Message{ messageIcon = messageIcon', .. } where messageIcon = fromMaybe defaultIcon messageIcon' defaultIcon = case messageStatus of - Success -> IconNotificationSuccess - Info -> IconNotificationInfo - Warning -> IconNotificationWarning - Error -> IconNotificationError + Success -> IconNotificationSuccess + Info -> IconNotificationInfo + Warning -> IconNotificationWarning + Error -> IconNotificationError + Nonactive -> IconNotificationNonactive notificationWidget :: Yesod site => NotificationType diff --git a/src/Utils/Icon.hs b/src/Utils/Icon.hs index d220f9f7f..f9fdc4234 100644 --- a/src/Utils/Icon.hs +++ b/src/Utils/Icon.hs @@ -72,6 +72,7 @@ data Icon | IconNotificationInfo | IconNotificationWarning | IconNotificationError + | IconNotificationNonactive | IconFavourite | IconLanguage | IconNavContainerClose | IconPageActionChildrenClose @@ -150,6 +151,7 @@ iconText = \case IconNotificationInfo -> "info-circle" IconNotificationWarning -> "exclamation-circle" IconNotificationError -> "exclamation-triangle" + IconNotificationNonactive -> "info" IconFavourite -> "star" IconLanguage -> "flag-alt" IconNavContainerClose -> "chevron-up" diff --git a/src/Utils/Message.hs b/src/Utils/Message.hs index 27ccafe41..61bce17c7 100644 --- a/src/Utils/Message.hs +++ b/src/Utils/Message.hs @@ -29,7 +29,7 @@ import Text.Blaze.Html.Renderer.Text (renderHtml) import Text.HTML.SanitizeXSS (sanitizeBalance) -data MessageStatus = Error | Warning | Info | Success +data MessageStatus = Error | Warning | Info | Success | Nonactive deriving (Eq, Ord, Enum, Bounded, Show, Read, Lift, Generic, Typeable) deriving anyclass (Universe, Finite, NFData) @@ -219,7 +219,7 @@ messageTooltip Message{..} = let urgency = statusToUrgencyClass messageStatus Utils.Message.Error -> IconProblem Utils.Message.Warning -> IconWarning Utils.Message.Success -> IconOK - Utils.Message.Info -> IconTooltipDefault) + _ -> IconTooltipDefault) messageIcon tooltip = toWidget messageContent :: WidgetFor site () isInlineTooltip = False