diff --git a/config/settings.yml b/config/settings.yml index 979dd8f4e..e7ce53607 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -214,6 +214,9 @@ user-defaults: warning-days: 1209600 show-sex: false schedule-view: view-week + schedule-week-time-from: 8 + schedule-week-time-to: 18 + schedule-week-timeslot-length: 2 # During central allocations lecturer-given ratings of applications (as # ExamGrades) are combined with a central priority. diff --git a/messages/uniworx/de-de-formal.msg b/messages/uniworx/de-de-formal.msg index d02d4e4fc..0c3e2f4b9 100644 --- a/messages/uniworx/de-de-formal.msg +++ b/messages/uniworx/de-de-formal.msg @@ -109,6 +109,16 @@ ScheduleViewWeek: Woche ProfileScheduleView: Standard-Ansicht ProfileScheduleViewTip: Betrifft die Terminübersicht auf „Aktuelles“ und „Terminübersicht“. (Weitere Ansichten sind in Arbeit.) +ScheduleWeekTimeFrom: Beginn (Stunde) des ersten in der Wochenansicht dargestellten Zeitslots +ScheduleWeekTimeFromTip: Stunde, zu welcher der erste in der Wochenansicht dargestellte Zeitslot beginnt. Gibt es einen darzustellenden Termin, der in einem Zeitslot vor dem hier angegebenen Zeitslot liegt, so wird der jeweilige Zeitslot als zusätzliche Zeile vor dem hier angegeben Zeitslot angezeigt. +ScheduleWeekTimeFromPlaceholder: Erster Zeitslot +ScheduleWeekTimeTo: Beginn (Stunde) des letzten in der Wochenansicht dargestellten Zeitslots +ScheduleWeekTimeToTip: Stunde, zu welcher der letzte in der Wochenansicht dargestellte Zeitslot beginnt. Gibt es einen darzustellenden Termin, der in einem Zeitslot nach dem hier angegebenen Zeitslot liegt, so wird der jeweilige Zeitslot als zusätzliche Zeile nach dem hier angegebenen Zeitslot angezeigt. +ScheduleWeekTimeToPlaceholder: Letzter Zeitslot +ScheduleWeekTimeslotLength: Länge (in Stunden) der in der Wochenansicht dargestellten Zeitslots +ScheduleWeekTimeslotLengthTip: Die Länge (in Stunden) jedes in der Wochenansicht der Terminübersicht als separate Zeile dargestellten Zeitslots +ScheduleWeekTimeslotLengthPlaceholder: Zeitslotlänge + ScheduleOffsetWeekBackwardWeek: 1 Woche zurück ScheduleOffsetWeekBackwardDay: 1 Tag zurück ScheduleOffsetWeekCurrent: Zu aktueller Woche springen diff --git a/messages/uniworx/en-eu.msg b/messages/uniworx/en-eu.msg index 533fbb332..a8bccee61 100644 --- a/messages/uniworx/en-eu.msg +++ b/messages/uniworx/en-eu.msg @@ -110,6 +110,16 @@ ScheduleViewWeek: Week ProfileScheduleView: Standard view ProfileScheduleViewTip: Relevant for the schedule on "News" and "Schedule". (More views are in the works.) +ScheduleWeekTimeFrom: Start (hour) of the first timeslot to display in the weekly schedule +ScheduleWeekTimeFromTip: The hour at which the first timeslot to display in the weekly schedule begins. If there is an occurrence to display which lies in a timeslot before the one given here, the respective timeslot will be displayed above this one as a separate row. +ScheduleWeekTimeFromPlaceholder: First timeslot +ScheduleWeekTimeTo: Start (hour) of the last timeslot to display in the weekly schedule +ScheduleWeekTimeToTip: The hour at which the last timeslot to display in the weekly schedule begins. If there is an occurrence to display which lies in a timeslot after the one given here, the respective timeslot will be displayed below this one as a separate row. +ScheduleWeekTimeToPlaceholder: Last timeslot +ScheduleWeekTimeslotLength: Length (in hours) of timeslots to display in the weekly schedule +ScheduleWeekTimeslotLengthTip: The length (in hours) of each timeslot to display as a separate row in the weekly schedule +ScheduleWeekTimeslotLengthPlaceholder: Timeslot length + ScheduleOffsetWeekBackwardWeek: 1 week back ScheduleOffsetWeekBackwardDay: 1 day back ScheduleOffsetWeekCurrent: Jump to current week diff --git a/models/users.model b/models/users.model index f3deba2ac..bcf8307ea 100644 --- a/models/users.model +++ b/models/users.model @@ -37,6 +37,9 @@ User json -- Each Uni2work user has a corresponding row in this table; create sex Sex Maybe showSex Bool default=false scheduleView ScheduleView default='ScheduleViewWeek' + scheduleWeekTimeFrom Int default=8 -- starting hour of the first time slot to display in weekly schedule by default (i.e. regardless of the existence of occurrences in this slot); TODO: increase precision to minutes + scheduleWeekTimeTo Int default=18 -- starting hour of the last time slot to display in weekly schedule by default (i.e. regardless of the existence of occurrences in this slot); TODO: increase precision to minutes; TODO: save last hour/minute to display instead of first (of last time slot) + scheduleWeekTimeslotLength Int default=2 -- length of one timeslot in hours; TODO: increase precision to minutes UniqueAuthentication ident -- Column 'ident' can be used as a row-key in this table UniqueEmail email -- Column 'email' can be used as a row-key in this table deriving Show Eq Ord Generic -- Haskell-specific settings for runtime-value representing a row in memory diff --git a/src/Foundation/Yesod/Auth.hs b/src/Foundation/Yesod/Auth.hs index 3feacb28f..bdb1f3bb4 100644 --- a/src/Foundation/Yesod/Auth.hs +++ b/src/Foundation/Yesod/Auth.hs @@ -258,6 +258,9 @@ upsertCampusUser upsertMode ldapData = do , userWarningDays = userDefaultWarningDays , userShowSex = userDefaultShowSex , userScheduleView = userDefaultScheduleView + , userScheduleWeekTimeFrom = userDefaultScheduleWeekTimeFrom + , userScheduleWeekTimeTo = userDefaultScheduleWeekTimeTo + , userScheduleWeekTimeslotLength = userDefaultScheduleWeekTimeslotLength , userNotificationSettings = def , userLanguages = Nothing , userCsvOptions = def diff --git a/src/Handler/Profile.hs b/src/Handler/Profile.hs index 6f807e312..3061aa86f 100644 --- a/src/Handler/Profile.hs +++ b/src/Handler/Profile.hs @@ -38,6 +38,9 @@ data SettingsForm = SettingsForm { stgDisplayName :: UserDisplayName , stgDisplayEmail :: UserEmail , stgScheduleView :: ScheduleView + , stgScheduleWeekTimeFrom :: Int + , stgScheduleWeekTimeTo :: Int + , stgScheduleWeekTimeslotLength :: Int , stgMaxFavourites :: Int , stgMaxFavouriteTerms :: Int , stgTheme :: Theme @@ -105,6 +108,12 @@ makeSettingForm template html = do <* aformSection MsgSchedule <*> areq (selectField . return $ mkOptionList (scheduleViewList mr)) (fslI MsgProfileScheduleView & setTooltip MsgProfileScheduleViewTip) { fsId = Just "schedule-view-select" } (stgScheduleView <$> template) + <*> areq (natFieldI MsgScheduleWeekTimeFrom) + (fslpI MsgScheduleWeekTimeFrom (mr MsgScheduleWeekTimeFromPlaceholder) & setTooltip MsgScheduleWeekTimeFromTip) (stgScheduleWeekTimeFrom <$> template) + <*> areq (natFieldI MsgScheduleWeekTimeTo ) + (fslpI MsgScheduleWeekTimeTo (mr MsgScheduleWeekTimeToPlaceholder ) & setTooltip MsgScheduleWeekTimeToTip ) (stgScheduleWeekTimeTo <$> template) + <*> areq (natFieldI MsgScheduleWeekTimeslotLength) + (fslpI MsgScheduleWeekTimeslotLength (mr MsgScheduleWeekTimeslotLengthPlaceholder) & setTooltip MsgScheduleWeekTimeslotLengthTip) (stgScheduleWeekTimeslotLength <$> template) <* aformSection MsgFormCosmetics <*> areq (natFieldI MsgFavouritesNotNatural) (fslpI MsgFavourites (mr MsgFavouritesPlaceholder) & setTooltip MsgFavouritesTip) (stgMaxFavourites <$> template) @@ -364,6 +373,9 @@ postProfileR = do { stgDisplayName = userDisplayName , stgDisplayEmail = userDisplayEmail , stgScheduleView = userScheduleView + , stgScheduleWeekTimeFrom = userScheduleWeekTimeFrom + , stgScheduleWeekTimeTo = userScheduleWeekTimeTo + , stgScheduleWeekTimeslotLength = userScheduleWeekTimeslotLength , stgMaxFavourites = userMaxFavourites , stgMaxFavouriteTerms = userMaxFavouriteTerms , stgTheme = userTheme diff --git a/src/Handler/Users/Add.hs b/src/Handler/Users/Add.hs index cbfa2b587..4949bfd40 100644 --- a/src/Handler/Users/Add.hs +++ b/src/Handler/Users/Add.hs @@ -77,6 +77,9 @@ postAdminUserAddR = do , userWarningDays = userDefaultWarningDays , userShowSex = userDefaultShowSex , userScheduleView = userDefaultScheduleView + , userScheduleWeekTimeFrom = userDefaultScheduleWeekTimeFrom + , userScheduleWeekTimeTo = userDefaultScheduleWeekTimeTo + , userScheduleWeekTimeslotLength = userDefaultScheduleWeekTimeslotLength , userNotificationSettings = def , userLanguages = Nothing , userCsvOptions = def diff --git a/src/Settings.hs b/src/Settings.hs index ae52f7921..20dd1a1df 100644 --- a/src/Settings.hs +++ b/src/Settings.hs @@ -214,6 +214,8 @@ data UserDefaultConf = UserDefaultConf , userDefaultWarningDays :: NominalDiffTime , userDefaultShowSex :: Bool , userDefaultScheduleView :: ScheduleView + , userDefaultScheduleWeekTimeFrom, userDefaultScheduleWeekTimeTo :: Int + , userDefaultScheduleWeekTimeslotLength :: Int } deriving (Show) data PWHashConf = PWHashConf