diff --git a/ChangeLog.md b/ChangeLog.md index 784dc8824..3e3d9dfe8 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,7 @@ + * Version 30.01.2019 + + Designänderungen + * Version 16.01.2019 Links für Bequemlichkeiten hinzugefügt (z.B. aktuelles Übungsblatt) diff --git a/src/Handler/Utils.hs b/src/Handler/Utils.hs index 7ccf0a731..3ecc4b932 100644 --- a/src/Handler/Utils.hs +++ b/src/Handler/Utils.hs @@ -69,3 +69,8 @@ warnTermDays tid times = do forM_ warnholidays $ warnI MsgDayIsAHoliday forM_ outoflecture $ warnI MsgDayIsOutOfLecture forM_ outoftermdays $ warnI MsgDayIsOutOfTerm + +visibleWidget :: Bool -> Widget +-- ^ @visibleWidget False@ is an icon that denotes that something™ is not visible +visibleWidget True = mempty +visibleWidget False = [whamlet||] diff --git a/src/Handler/Utils/Submission.hs b/src/Handler/Utils/Submission.hs index a397041a8..124da1b83 100644 --- a/src/Handler/Utils/Submission.hs +++ b/src/Handler/Utils/Submission.hs @@ -130,7 +130,9 @@ assignSubmissions sid restriction = do props = getSum $ foldMap (Sum . fst) assignments toDeficit' (prop, assigned) = let - target = round $ fromInteger assigned' * (prop / props) + target + | props == 0 = 0 + | otherwise = round $ fromInteger assigned' * (prop / props) in target - assigned $logDebugS "assignSubmissions" $ "Previous submissions: " <> tshow prevSubs' diff --git a/templates/adminTest.hamlet b/templates/adminTest.hamlet index 2cc3f24f3..8290759e6 100644 --- a/templates/adminTest.hamlet +++ b/templates/adminTest.hamlet @@ -36,3 +36,5 @@ ^{modal "Klick mich für Content-Test" (Right "Test Inhalt für Modal")}
  • ^{modal "Email-Test" (Right emailWidget')} +
  • + ^{visibleWidget False}