From 78fc27dc045b417bacf9707e963afb175c2409b6 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 30 Jan 2019 09:44:16 +0100 Subject: [PATCH 1/3] Introduce visibleWidget --- src/Handler/Utils.hs | 5 +++++ templates/adminTest.hamlet | 2 ++ 2 files changed, 7 insertions(+) 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/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} From 2bea5435bf1e1ff9f1075433f831198d7235a097 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 30 Jan 2019 10:07:31 +0100 Subject: [PATCH 2/3] Avoid divide by zero --- src/Handler/Utils/Submission.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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' From e8ad4e4a132a348670266bb0ac96680612e22052 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 30 Jan 2019 10:08:44 +0100 Subject: [PATCH 3/3] Bump ChangeLog --- ChangeLog.md | 4 ++++ 1 file changed, 4 insertions(+) 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)