From 839251ede34f99446e371c4119abca535cf0b834 Mon Sep 17 00:00:00 2001 From: Steffen Jost Date: Thu, 22 Aug 2019 18:07:22 +0200 Subject: [PATCH] fix(home): fix hlint and other minor bugs --- messages/uniworx/de.msg | 2 +- src/Handler/Allocation/Info.hs | 2 +- src/Handler/Profile.hs | 1 + src/Utils/Form.hs | 2 +- test/ModelSpec.hs | 1 + 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/messages/uniworx/de.msg b/messages/uniworx/de.msg index a9603b270..256f2a000 100644 --- a/messages/uniworx/de.msg +++ b/messages/uniworx/de.msg @@ -596,7 +596,7 @@ MultiSinkException name@Text error@Text: In Abgabe #{name} ist ein Fehler aufget NoTableContent: Kein Tabelleninhalt NoUpcomingSheetDeadlines: Keine anstehenden Übungsblätter -NoUpcomingExams difftime@Text: In den nächsten #{difftime} gibt es keine Prüfung oder ablaufende Prüfungsanmeldungen in Ihren Kursen +NoUpcomingExams difftime@Text: In den nächsten #{difftime} gibt es keine Prüfungen oder ablaufende Prüfungsanmeldungen in Ihren Kursen AdminHeading: Administration AdminUserHeading: Benutzeradministration diff --git a/src/Handler/Allocation/Info.hs b/src/Handler/Allocation/Info.hs index d3140d75a..f6aacf063 100644 --- a/src/Handler/Allocation/Info.hs +++ b/src/Handler/Allocation/Info.hs @@ -7,7 +7,7 @@ import Handler.Utils getInfoAllocationR :: Handler Html -getInfoAllocationR = do +getInfoAllocationR = siteLayoutMsg MsgMenuAllocationInfo $ do setTitleI MsgMenuAllocationInfo $(i18nWidgetFile "allocation-info") diff --git a/src/Handler/Profile.hs b/src/Handler/Profile.hs index e4a08f547..11b9728a3 100644 --- a/src/Handler/Profile.hs +++ b/src/Handler/Profile.hs @@ -197,6 +197,7 @@ postProfileR = do , UserDateFormat =. stgDate , UserTimeFormat =. stgTime , UserDownloadFiles =. stgDownloadFiles + , UserWarningDays =. stgWarningDays , UserNotificationSettings =. stgNotificationSettings ] when (stgMaxFavourties < userMaxFavourites) $ do diff --git a/src/Utils/Form.hs b/src/Utils/Form.hs index 36afaa515..acacc60fe 100644 --- a/src/Utils/Form.hs +++ b/src/Utils/Form.hs @@ -567,7 +567,7 @@ intMinMaxField lower upper = intF{ fieldView=newView } newAttrs = [ (a,tshow v) | (a,Just v) <- [("min", lower),("max", upper)] ] daysField :: (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m NominalDiffTime -daysField = convertField toDays fromDays fractionalField +daysField = convertField fromDays toDays fractionalField where toDays = (/ nominalDay) fromDays = (* nominalDay) diff --git a/test/ModelSpec.hs b/test/ModelSpec.hs index 8599e4376..0549a5692 100644 --- a/test/ModelSpec.hs +++ b/test/ModelSpec.hs @@ -98,6 +98,7 @@ instance Arbitrary User where userTimeFormat <- genDateTimeFormat SelFormatTime userDownloadFiles <- arbitrary + userWarningDays <- arbitrary userMailLanguages <- arbitrary userNotificationSettings <- arbitrary