From 4151f62fa58e3ebd8894e407be6c2c46f3ec5d5b Mon Sep 17 00:00:00 2001 From: Sarah Vaupel <> Date: Wed, 28 Oct 2020 16:11:32 +0100 Subject: [PATCH] feat(schedule): enhance messages, restructure profile form --- messages/uniworx/de-de-formal.msg | 7 +++---- messages/uniworx/en-eu.msg | 7 +++---- src/Handler/Profile.hs | 11 ++++++----- templates/news/schedule.hamlet | 2 +- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/messages/uniworx/de-de-formal.msg b/messages/uniworx/de-de-formal.msg index 0e54d3b66..b113f4f1d 100644 --- a/messages/uniworx/de-de-formal.msg +++ b/messages/uniworx/de-de-formal.msg @@ -101,14 +101,13 @@ TermLectureEnd: Ende Vorlesungen TermLectureEndTooltip: Meistens dauer das Sommersemester 14 Wochen und das Wintersemester 15 Wochen. TermActive: Aktiv - -ScheduleTitle: Terminübersicht +Schedule: Terminübersicht ScheduleView: Ansicht ScheduleViewWeek: Woche -ProfileScheduleView: Standard-Ansicht der Terminübersicht -ProfileScheduleViewTip: Betrifft Terminübersicht auf „Aktuelles“ und „Terminübersicht“ (weitere Ansichten in Arbeit) +ProfileScheduleView: Standard-Ansicht +ProfileScheduleViewTip: Betrifft die Terminübersicht auf „Aktuelles“ und „Terminübersicht“. (Weitere Ansichten sind in Arbeit.) ScheduleOffsetWeekBackwardWeek: 1 Woche zurück ScheduleOffsetWeekBackwardDay: 1 Tag zurück diff --git a/messages/uniworx/en-eu.msg b/messages/uniworx/en-eu.msg index 0c89abb57..096f5f519 100644 --- a/messages/uniworx/en-eu.msg +++ b/messages/uniworx/en-eu.msg @@ -102,14 +102,13 @@ TermLectureEnd: Lectures end TermLectureEndTooltip: Summer semesters are usually 14 weeks; winter semesters 15 TermActive: Active - -ScheduleTitle: Schedule +Schedule: Schedule ScheduleView: View ScheduleViewWeek: Week -ProfileScheduleView: Standard schedule view -ProfileScheduleViewTip: Relevant for schedule on "News" and "Schedule" (more views are in the works) +ProfileScheduleView: Standard view +ProfileScheduleViewTip: Relevant for the schedule on "News" and "Schedule". (More views are in the works.) ScheduleOffsetWeekBackwardWeek: 1 week back ScheduleOffsetWeekBackwardDay: 1 day back diff --git a/src/Handler/Profile.hs b/src/Handler/Profile.hs index 0030dd0d0..f5605093b 100644 --- a/src/Handler/Profile.hs +++ b/src/Handler/Profile.hs @@ -37,13 +37,13 @@ import Utils.Schedule.Types.ScheduleView data SettingsForm = SettingsForm { stgDisplayName :: UserDisplayName , stgDisplayEmail :: UserEmail + , stgScheduleView :: ScheduleView , stgMaxFavourites :: Int , stgMaxFavouriteTerms :: Int , stgTheme :: Theme , stgDateTime :: DateTimeFormat , stgDate :: DateTimeFormat , stgTime :: DateTimeFormat - , stgScheduleView :: ScheduleView , stgDownloadFiles :: Bool , stgWarningDays :: NominalDiffTime , stgShowSex :: Bool @@ -101,6 +101,9 @@ makeSettingForm template html = do <$ aformSection MsgFormPersonalAppearance <*> areq (textField & cfStrip) (fslI MsgUserDisplayName & setTooltip MsgUserDisplayNameRulesBelow) (stgDisplayName <$> template) <*> areq (emailField & cfStrip & cfCI) (fslI MsgUserDisplayEmail & setTooltip MsgUserDisplayEmailTip) (stgDisplayEmail <$> template) + <* aformSection MsgSchedule + <*> areq (selectField . return $ mkOptionList (scheduleViewList mr)) + (fslI MsgProfileScheduleView & setTooltip MsgProfileScheduleViewTip) { fsId = Just "schedule-view-select" } (stgScheduleView <$> template) <* aformSection MsgFormCosmetics <*> areq (natFieldI MsgFavouritesNotNatural) (fslpI MsgFavourites (mr MsgFavouritesPlaceholder) & setTooltip MsgFavouritesTip) (stgMaxFavourites <$> template) @@ -111,8 +114,6 @@ makeSettingForm template html = do <*> areq (selectField $ dateTimeFormatOptions SelFormatDateTime) (fslI MsgDateTimeFormat) (stgDateTime <$> template) <*> areq (selectField $ dateTimeFormatOptions SelFormatDate) (fslI MsgDateFormat) (stgDate <$> template) <*> areq (selectField $ dateTimeFormatOptions SelFormatTime) (fslI MsgTimeFormat) (stgTime <$> template) - <*> areq (selectField . return $ mkOptionList (scheduleViewList mr)) - (fslI MsgProfileScheduleView & setTooltip MsgProfileScheduleViewTip) { fsId = Just "schedule-view-select" } (stgScheduleView <$> template) <* aformSection MsgFormBehaviour <*> apopt checkBoxField (fslI MsgDownloadFiles & setTooltip MsgDownloadFilesTip @@ -359,13 +360,13 @@ postProfileR = do let settingsTemplate = Just SettingsForm { stgDisplayName = userDisplayName , stgDisplayEmail = userDisplayEmail + , stgScheduleView = userScheduleView , stgMaxFavourites = userMaxFavourites , stgMaxFavouriteTerms = userMaxFavouriteTerms , stgTheme = userTheme , stgDateTime = userDateTimeFormat , stgDate = userDateFormat , stgTime = userTimeFormat - , stgScheduleView = userScheduleView , stgDownloadFiles = userDownloadFiles , stgSchools = userSchools , stgNotificationSettings = userNotificationSettings @@ -379,13 +380,13 @@ postProfileR = do runDBJobs $ do update uid $ [ UserDisplayName =. stgDisplayName + , UserScheduleView =. stgScheduleView , UserMaxFavourites =. stgMaxFavourites , UserMaxFavouriteTerms =. stgMaxFavouriteTerms , UserTheme =. stgTheme , UserDateTimeFormat =. stgDateTime , UserDateFormat =. stgDate , UserTimeFormat =. stgTime - , UserScheduleView =. stgScheduleView , UserDownloadFiles =. stgDownloadFiles , UserWarningDays =. stgWarningDays , UserNotificationSettings =. stgNotificationSettings diff --git a/templates/news/schedule.hamlet b/templates/news/schedule.hamlet index 89864d6b2..ba2c52931 100644 --- a/templates/news/schedule.hamlet +++ b/templates/news/schedule.hamlet @@ -2,5 +2,5 @@ $newline never

- _{MsgScheduleTitle} + _{MsgSchedule} ^{schedule}