feat(course-teaser): checkbox field for open registration filter

This commit is contained in:
Sarah Vaupel 2019-08-09 16:57:08 +02:00
parent f7fb3c1219
commit e4f150d0d5

View File

@ -8,6 +8,8 @@ module Handler.Course.List
import Import
import Data.Maybe (fromJust)
import Utils.Lens
import Utils.Form
-- import Utils.DB
@ -158,7 +160,7 @@ makeCourseTable whereClause colChoices psValidator = do
, Just $ prismAForm (singletonFilter "schoolshort" . maybePrism (_PathPiece . from _SchoolId)) mPrev $ aopt (hoistField lift schoolField) (fslI MsgCourseSchool)
, Just $ prismAForm (singletonFilter "lecturer") mPrev $ aopt textField (fslI MsgCourseLecturer)
, Just $ prismAForm (singletonFilter "search") mPrev $ aopt textField (fslI MsgCourseFilterSearch)
, Just $ prismAForm (singletonFilter "openregistration" . maybePrism _PathPiece) mPrev $ aopt boolField (fslI MsgCourseRegisterOpen) -- TODO: checkbox instead of boolField
, Just $ prismAForm (singletonFilter "openregistration" . maybePrism _PathPiece) mPrev $ fmap (\x -> if isJust x && not (fromJust x) then Nothing else x) . aopt checkBoxField (fslI MsgCourseRegisterOpen)
, muid $> prismAForm (singletonFilter "registered" . maybePrism _PathPiece) mPrev (aopt boolField (fslI MsgCourseFilterRegistered))
]
, dbtStyle = def