From 7af82bcb67d0ec6ae33aa82067b3d1f4de0d74de Mon Sep 17 00:00:00 2001 From: Sarah Vaupel <> Date: Fri, 24 Jul 2020 20:51:50 +0200 Subject: [PATCH] feat(course-visibility): reorder course form --- src/Handler/Course/Edit.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Handler/Course/Edit.hs b/src/Handler/Course/Edit.hs index 74f30ccb7..4b0fa3107 100644 --- a/src/Handler/Course/Edit.hs +++ b/src/Handler/Course/Edit.hs @@ -36,6 +36,8 @@ data CourseForm = CourseForm , cfTerm :: TermId , cfDesc :: Maybe Html , cfLink :: Maybe Text + , cfVisFrom :: Maybe UTCTime + , cfVisTo :: Maybe UTCTime , cfMatFree :: Bool , cfAllocation :: Maybe AllocationCourseForm , cfAppRequired :: Bool @@ -46,8 +48,6 @@ data CourseForm = CourseForm , cfAppRatingsVisible :: Bool , cfCapacity :: Maybe Int , cfSecret :: Maybe Text - , cfVisFrom :: Maybe UTCTime - , cfVisTo :: Maybe UTCTime , cfRegFrom :: Maybe UTCTime , cfRegTo :: Maybe UTCTime , cfDeRegUntil :: Maybe UTCTime @@ -277,7 +277,11 @@ makeCourseForm miButtonAction template = identifyForm FIDcourse . validateFormDB (cfDesc <$> template) <*> aopt (urlField & cfStrip) (fslpI MsgCourseHomepageExternal (mr MsgCourseHomepageExternalPlaceholder)) (cfLink <$> template) - <*> apopt checkBoxField (fslI MsgMaterialFree) (cfMatFree <$> template) + <*> aopt utcTimeField (fslpI MsgCourseVisibleFrom (mr MsgDate) + & setTooltip MsgCourseVisibleFromTip) (cfVisFrom <$> template) + <*> aopt utcTimeField (fslpI MsgCourseVisibleTo (mr MsgDate) + & setTooltip MsgCourseVisibleToTip) (cfVisTo <$> template) + <*> apopt checkBoxField (fslI MsgMaterialFree) (cfMatFree <$> template) <* aformSection MsgCourseFormSectionRegistration <*> allocationForm <*> apopt checkBoxField (fslI MsgCourseApplicationRequired & setTooltip MsgCourseApplicationRequiredTip) (cfAppRequired <$> template) @@ -290,10 +294,6 @@ makeCourseForm miButtonAction template = identifyForm FIDcourse . validateFormDB & setTooltip MsgCourseCapacityTip) (cfCapacity <$> template) <*> aopt (textField & cfStrip) (fslpI MsgCourseSecret (mr MsgCourseSecretFormat) & setTooltip MsgCourseSecretTip) (cfSecret <$> template) - <*> aopt utcTimeField (fslpI MsgCourseVisibleFrom (mr MsgDate) - & setTooltip MsgCourseVisibleFromTip) (cfVisFrom <$> template) - <*> aopt utcTimeField (fslpI MsgCourseVisibleTo (mr MsgDate) - & setTooltip MsgCourseVisibleToTip) (cfVisTo <$> template) <*> aopt utcTimeField (fslpI MsgRegisterFrom (mr MsgDate) & setTooltip MsgCourseRegisterFromTip) (deepAlt (cfRegFrom <$> template) newRegFrom) <*> aopt utcTimeField (fslpI MsgRegisterTo (mr MsgDate)