Fixes #291
This commit is contained in:
parent
ed8beb9e81
commit
90d3135f15
@ -8,6 +8,7 @@ import Utils.Lens
|
||||
|
||||
import qualified Data.CaseInsensitive as CI
|
||||
|
||||
import Data.List (nub)
|
||||
import qualified Data.Set as Set
|
||||
import qualified Data.Map as Map
|
||||
|
||||
@ -23,9 +24,6 @@ hijackUserForm cID csrf = do
|
||||
|
||||
getUsersR :: Handler Html
|
||||
getUsersR = do
|
||||
-- schoolOptions <- runDB $ do
|
||||
-- courses <- selectList [] [Asc CourseSchool] -- >>= filterM (\(Entity _ Course{..}) -> (== Authorized) <$> evalAccessCorrector courseTerm courseSchool courseShorthand)
|
||||
-- optionsPairs $ map (id &&& id) $ nub $ map (CI.original . unSchoolKey . courseSchool . entityVal) courses
|
||||
let
|
||||
dbtColonnade = dbColonnade . mconcat $
|
||||
[ dbRow
|
||||
@ -74,6 +72,10 @@ getUsersR = do
|
||||
psValidator = def
|
||||
& defaultSorting [SortAscBy "name", SortAscBy "display-name"]
|
||||
|
||||
schoolOptions = runDB $ do
|
||||
courses <- selectList [] [Asc CourseSchool] -- >>= filterM (\(Entity _ Course{..}) -> (== Authorized) <$> evalAccessCorrector courseTerm courseSchool courseShorthand)
|
||||
optionsPairs $ map (id &&& id) $ nub $ map (CI.original . unSchoolKey . courseSchool . entityVal) courses
|
||||
|
||||
((), userList) <- runDB $ dbTable psValidator DBTable
|
||||
{ dbtSQLQuery = return :: E.SqlExpr (Entity User) -> E.SqlQuery (E.SqlExpr (Entity User))
|
||||
, dbtRowKey = (E.^. UserId)
|
||||
@ -118,8 +120,8 @@ getUsersR = do
|
||||
-- , prismAForm (singletonFilter "matriculation" ) mPrev $ aopt (searchField False) (fslI MsgMatrikelNr)
|
||||
, prismAForm (singletonFilter "matriculation" ) mPrev $ aopt matriculationField (fslI MsgMatrikelNr)
|
||||
|
||||
-- , prismAForm (singletonFilter "school" ) mPrev $ aopt (selectField schoolOptions) (fslI MsgCourseSchool)
|
||||
-- , prismAForm (singletonFilter "school" ) mPrev $ aopt (lift `hoistField` schoolField) (fslI MsgCourseSchool)
|
||||
, prismAForm (singletonFilter "school" ) mPrev $ aopt (lift `hoistField` (selectField schoolOptions)) (fslI MsgCourseSchool)
|
||||
--, prismAForm (singletonFilter "school" ) mPrev $ aopt (lift `hoistField` schoolField) (fslI MsgCourseSchool)
|
||||
]
|
||||
, dbtStyle = def { dbsFilterLayout = defaultDBSFilterLayout }
|
||||
, dbtParams = def
|
||||
|
||||
Loading…
Reference in New Issue
Block a user