diff --git a/src/Handler/Admin.hs b/src/Handler/Admin.hs index a992d9eb9..e8f48f5c3 100644 --- a/src/Handler/Admin.hs +++ b/src/Handler/Admin.hs @@ -146,6 +146,7 @@ postAdminTestR = do $forall m <- msgs
  • #{m} |] + let testTooltip = toWidget [whamlet|Hier könnte Ihr Tooltip stehen!|] :: WidgetFor UniWorX () {- The following demonstrates the use of @massInput@. diff --git a/src/Utils/Icon.hs b/src/Utils/Icon.hs index 73fa340b5..bc2db742d 100644 --- a/src/Utils/Icon.hs +++ b/src/Utils/Icon.hs @@ -116,10 +116,11 @@ icon ic = [shamlet| -- Create an icon (defaults to "?") with a specified tooltip iconTooltip :: forall site. WidgetFor site () -> Maybe Icon -> WidgetFor site () -iconTooltip tt mic = let ic = iconText $ case mic of - Nothing -> IconTooltipDefault - Just i -> i - in $(whamletFile "templates/widgets/tooltip.hamlet") +iconTooltip tooltip mIcon = let ic = iconText $ case mIcon of + Nothing -> IconTooltipDefault + Just i -> i + urgency = "urgency__info" :: Text + in $(whamletFile "templates/widgets/tooltip.hamlet") -- declare constats for all icons for compatibility and convenience -- "IconCourse" generates "iconCourse = icon IconCourse" diff --git a/src/Utils/Message.hs b/src/Utils/Message.hs index 9e12e7c57..97ca8ce35 100644 --- a/src/Utils/Message.hs +++ b/src/Utils/Message.hs @@ -193,4 +193,10 @@ messageWidget mc wgt = do getMessages :: MonadHandler m => m [Message] getMessages = fmap decodeMessage <$> ClassyPrelude.Yesod.getMessages - +messageTooltip :: forall site. Message -> WidgetFor site () +messageTooltip Message{..} = let urgency = statusToUrgencyClass messageStatus + ic = iconText $ case messageIcon of + Nothing -> IconWarning + Just i -> i + tooltip = toWidget messageContent :: WidgetFor site () + in $(whamletFile "templates/widgets/tooltip.hamlet") diff --git a/templates/adminTest.hamlet b/templates/adminTest.hamlet index b3f1a8ca2..d402f06d9 100644 --- a/templates/adminTest.hamlet +++ b/templates/adminTest.hamlet @@ -8,10 +8,7 @@ Der Handler sollte jeweils aktuelle Beispiele für alle möglichen Funktionalitäten enthalten, so dass man immer weiß, wo man nachschlagen kann.

    -

    -
    -
    Hier könnte Ihr Tooltip stehen! - Hier ist ein Text mit einem eingebetteten Tooltip. + ^{iconTooltip testTooltip Nothing}

    diff --git a/templates/course/lecturerMassInput/cellInvitation.hamlet b/templates/course/lecturerMassInput/cellInvitation.hamlet index 523d9577b..54ce6a15f 100644 --- a/templates/course/lecturerMassInput/cellInvitation.hamlet +++ b/templates/course/lecturerMassInput/cellInvitation.hamlet @@ -6,6 +6,7 @@

    + #{iconWarning}
    _{MsgEmailInvitationWarning} diff --git a/templates/widgets/tooltip.hamlet b/templates/widgets/tooltip.hamlet index 50318f743..fc92c5717 100644 --- a/templates/widgets/tooltip.hamlet +++ b/templates/widgets/tooltip.hamlet @@ -1,7 +1,7 @@ $newline never
    -
    +
    - ^{tt} + ^{tooltip}