feat(tutoriumsdaten): firts draft

This commit is contained in:
ros 2021-08-29 14:14:21 +02:00 committed by Sarah Vaupel
parent ebcb23429f
commit e972788f54
3 changed files with 13 additions and 1 deletions

View File

@ -719,3 +719,4 @@ addPWEntry User{ userAuthentication = _, ..} (Text.encodeUtf8 -> pw) = db' $ do
PWHashConf{..} <- getsYesod $ view _appAuthPWHash
(AuthPWHash . Text.decodeUtf8 -> userAuthentication) <- liftIO $ makePasswordWith pwHashAlgorithm pw pwHashStrength
void $ insert User{..}

View File

@ -55,7 +55,7 @@ postTUsersR tid ssh csh tutn = do
cid <- getKeyBy404 $ TermSchoolCourseShort tid ssh csh
table <- makeCourseUserTable cid (Map.fromList $ map (id &&& pure) universeF) isInTut colChoices psValidator (Just csvColChoices)
return (tut, table)
formResult participantRes $ \case
(TutorialUserSendMail, selectedUsers) -> do
cids <- traverse encrypt $ Set.toList selectedUsers :: Handler [CryptoUUIDUser]
@ -67,6 +67,12 @@ postTUsersR tid ssh csh tutn = do
]
addMessageI Success $ MsgTutorialUsersDeregistered nrDel
redirect $ CTutorialR tid ssh csh tutn TUsersR
tutors <- runDB $
E.select $ E.from $ \(tutor `E.InnerJoin` user) -> do
E.on $ tutor E.^. TutorUser E.==. user E.^. UserId
E.where_ $ tutor E.^. TutorTutorial E.==. E.val tutid
return user
let heading = prependCourseTitle tid ssh csh $ CI.original tutorialName
siteLayoutMsg heading $ do

View File

@ -5,4 +5,9 @@ $newline never
<dd .deflist__dd>
^{occurrencesWidget tutorialTime}
<dt .deflist__dt>_{MsgTableTutorialTutors}
<dd .deflist__dd>
<ul>
$forall (Entity _ User{userDisplayName, userDisplayEmail, userSurname}) <- tutors
<li>
^{nameEmailWidget userDisplayEmail userDisplayName userSurname}
^{participantTable}