feat(tooltips): replace tooltips

This commit is contained in:
Sarah Vaupel 2019-10-01 14:06:03 +02:00
parent 276dcb6ad9
commit 3b0e1d570d
9 changed files with 20 additions and 27 deletions

View File

@ -137,7 +137,8 @@ examCorrectorsForm mPrev = wFormToAForm $ do
miCell' :: Either UserEmail UserId -> Widget miCell' :: Either UserEmail UserId -> Widget
miCell' (Left email) = miCell' (Left email) = do
invWarnMsg <- messageI Warning MsgEmailInvitationWarning
$(widgetFile "widgets/massinput/examCorrectors/cellInvitation") $(widgetFile "widgets/massinput/examCorrectors/cellInvitation")
miCell' (Right userId) = do miCell' (Right userId) = do
User{..} <- liftHandler . runDB $ get404 userId User{..} <- liftHandler . runDB $ get404 userId

View File

@ -103,7 +103,9 @@ makeExamOfficeUsersForm template = renderWForm FormStandard $ do
-> pure . nub $ oldUsers ++ Set.toList newUsers -> pure . nub $ oldUsers ++ Set.toList newUsers
return (res', $(widgetFile "widgets/massinput/examOfficeUsers/add")) return (res', $(widgetFile "widgets/massinput/examOfficeUsers/add"))
miCell' :: Either UserEmail UserId -> Widget miCell' :: Either UserEmail UserId -> Widget
miCell' (Left email) = $(widgetFile "widgets/massinput/examOfficeUsers/cellInvitation") miCell' (Left email) = do
invWarnMsg <- messageI Warning MsgEmailInvitationWarning
$(widgetFile "widgets/massinput/examOfficeUsers/cellInvitation")
miCell' (Right uid) = do miCell' (Right uid) = do
User{..} <- liftHandler . runDB $ getJust uid User{..} <- liftHandler . runDB $ getJust uid
$(widgetFile "widgets/massinput/examOfficeUsers/cellKnown") $(widgetFile "widgets/massinput/examOfficeUsers/cellKnown")

View File

@ -422,11 +422,12 @@ getSShowR tid ssh csh shn = do
setTitleI $ prependCourseTitle tid ssh csh $ SomeMessage shn setTitleI $ prependCourseTitle tid ssh csh $ SomeMessage shn
let zipLink = CSheetR tid ssh csh shn SArchiveR let zipLink = CSheetR tid ssh csh shn SArchiveR
visibleFrom = visibleUTCTime SelFormatDateTime <$> sheetVisibleFrom sheet visibleFrom = visibleUTCTime SelFormatDateTime <$> sheetVisibleFrom sheet
sheetFrom <- formatTime SelFormatDateTime $ sheetActiveFrom sheet sheetFrom <- formatTime SelFormatDateTime $ sheetActiveFrom sheet
sheetTo <- formatTime SelFormatDateTime $ sheetActiveTo sheet sheetTo <- formatTime SelFormatDateTime $ sheetActiveTo sheet
hintsFrom <- traverse (formatTime SelFormatDateTime) $ sheetHintFrom sheet hintsFrom <- traverse (formatTime SelFormatDateTime) $ sheetHintFrom sheet
solutionFrom <- traverse (formatTime SelFormatDateTime) $ sheetSolutionFrom sheet solutionFrom <- traverse (formatTime SelFormatDateTime) $ sheetSolutionFrom sheet
markingText <- runMaybeT $ assertM_ (Authorized ==) (evalAccessCorrector tid ssh csh) >> hoistMaybe (sheetMarkingText sheet) markingText <- runMaybeT $ assertM_ (Authorized ==) (evalAccessCorrector tid ssh csh) >> hoistMaybe (sheetMarkingText sheet)
submissionTip <- messageI Info MsgSheetCorrectorSubmissionsTip
$(widgetFile "sheetShow") $(widgetFile "sheetShow")
getSArchiveR :: TermId -> SchoolId -> CourseShorthand -> SheetName -> Handler TypedContent getSArchiveR :: TermId -> SchoolId -> CourseShorthand -> SheetName -> Handler TypedContent
@ -765,6 +766,7 @@ correctorForm shid = wFormToAForm $ do
Right uid -> do Right uid -> do
User{userEmail, userDisplayName, userSurname} <- liftHandler . runDB $ getJust uid User{userEmail, userDisplayName, userSurname} <- liftHandler . runDB $ getJust uid
return $ nameEmailWidget userEmail userDisplayName userSurname return $ nameEmailWidget userEmail userDisplayName userSurname
invWarnMsg <- messageI Warning MsgEmailInvitationWarning
return (res, $(widgetFile "sheetCorrectors/cell")) return (res, $(widgetFile "sheetCorrectors/cell"))

View File

@ -131,7 +131,9 @@ makeSubmissionForm cid msmid uploadMode grouping isLecturer prefillUsers = ident
<*> wFormToAForm submittorsForm <*> wFormToAForm submittorsForm
where where
miCell' :: Markup -> Either UserEmail UserId -> Widget miCell' :: Markup -> Either UserEmail UserId -> Widget
miCell' csrf (Left email) = $(widgetFile "widgets/massinput/submissionUsers/cellInvitation") miCell' csrf (Left email) = do
invWarnMsg <- messageI Warning MsgEmailInvitationWarning
$(widgetFile "widgets/massinput/submissionUsers/cellInvitation")
miCell' csrf (Right uid) = do miCell' csrf (Right uid) = do
User{..} <- liftHandler . runDB $ getJust uid User{..} <- liftHandler . runDB $ getJust uid
$(widgetFile "widgets/massinput/submissionUsers/cellKnown") $(widgetFile "widgets/massinput/submissionUsers/cellKnown")

View File

@ -4,10 +4,7 @@ $case userIdent
<td> <td>
^{identWidget} ^{identWidget}
<td> <td>
<div .tooltip> ^{messageTooltip invWarnMsg}
<div .tooltip__handle>
<div .tooltip__content>
_{MsgEmailInvitationWarning}
$of Right _ $of Right _
<td colspan=2> <td colspan=2>
^{identWidget} ^{identWidget}

View File

@ -28,9 +28,7 @@ $maybe descr <- sheetDescription sheet
<dd .deflist__dd>_{classifySubmissionMode (sheetSubmissionMode sheet)} <dd .deflist__dd>_{classifySubmissionMode (sheetSubmissionMode sheet)}
$case sheetSubmissionMode sheet $case sheetSubmissionMode sheet
$of SubmissionMode True _ $of SubmissionMode True _
<div .tooltip> ^{messageTooltip submissionTip}
<div .tooltip__handle>
<div .tooltip__content>_{MsgSheetCorrectorSubmissionsTip}
$of _ $of _
$case sheetSubmissionMode sheet $case sheetSubmissionMode sheet
$of SubmissionMode True _ $of SubmissionMode True _

View File

@ -3,7 +3,4 @@ $newline never
<span style="font-family: monospace"> <span style="font-family: monospace">
#{email} #{email}
<td> <td>
<div .tooltip> ^{messageTooltip invWarnMsg}
<div .tooltip__handle>
<div .tooltip__content>
_{MsgEmailInvitationWarning}

View File

@ -3,7 +3,4 @@
<span style="font-family: monospace"> <span style="font-family: monospace">
#{email} #{email}
<td> <td>
<div .tooltip> ^{messageTooltip invWarnMsg}
<div .tooltip__handle>
<div .tooltip__content>
_{MsgEmailInvitationWarning}

View File

@ -4,7 +4,4 @@
<span style="font-family: monospace"> <span style="font-family: monospace">
#{email} #{email}
<td> <td>
<div .tooltip> ^{messageTooltip invWarnMsg}
<div .tooltip__handle>
<div .tooltip__content>
_{MsgEmailInvitationWarning}