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)