From 77e7e77e7453f9fb9cfda04504cac005e500a717 Mon Sep 17 00:00:00 2001 From: SJost Date: Tue, 10 Oct 2017 00:24:25 +0200 Subject: [PATCH] Course editing works now, deletion not due to SQLconstraints (lecturers need deletion). --- src/Handler/Course.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Handler/Course.hs b/src/Handler/Course.hs index 0834adfbc..1a877fce6 100644 --- a/src/Handler/Course.hs +++ b/src/Handler/Course.hs @@ -165,7 +165,7 @@ courseToForm cEntity = CourseForm , cfDesc = courseDescription course , cfLink = courseLinkExternal course , cfShort = courseShorthand course - , cfTerm = unTermKey $ courseTermId course + , cfTerm = unTermKey $ courseTermId course , cfSchool = courseSchoolId course , cfCapacity = courseCapacity course , cfRegFrom = courseRegisterFrom course @@ -177,7 +177,8 @@ courseToForm cEntity = CourseForm newCourseForm :: Maybe CourseForm -> Form CourseForm newCourseForm template html = do (result, widget) <- flip (renderBootstrap3 bsHorizontalDefault) html $ CourseForm - <$> pure cid -- $ join $ cfCourseId <$> template -- why doesnt this work? + -- <$> pure cid -- $ join $ cfCourseId <$> template -- why doesnt this work? + <$> aopt hiddenField "courseId" (cfCourseId <$> template) <*> areq textField (set "Name") (cfName <$> template) <*> aopt htmlField (set "Beschreibung") (cfDesc <$> template) <*> aopt urlField (set "Homepage") (cfLink <$> template)