chore(users-add): add missing cases of participant result messages

This commit is contained in:
Sarah Vaupel 2022-12-06 22:44:39 +01:00
parent 2235e64444
commit 1445c8f69a
5 changed files with 24 additions and 7 deletions

View File

@ -118,6 +118,7 @@ CourseParticipantsRegisterNoneGiven: Es wurden keine anzumeldenden Personen ange
CourseParticipantsInvited n@Int: #{n} #{pluralDE n "Einladung" "Einladungen"} per E-Mail verschickt CourseParticipantsInvited n@Int: #{n} #{pluralDE n "Einladung" "Einladungen"} per E-Mail verschickt
CourseParticipantsAddedByAvs n@Int: #{n} AVS-Nutzer erfolgreich angemeldet (TODO) CourseParticipantsAddedByAvs n@Int: #{n} AVS-Nutzer erfolgreich angemeldet (TODO)
CourseParticipantsAlreadyRegistered n@Int: #{n} #{pluralDE n "Teinehmer:in" "Teilnehmer:innen"} #{pluralDE n "ist" "sind"} bereits angemeldet CourseParticipantsAlreadyRegistered n@Int: #{n} #{pluralDE n "Teinehmer:in" "Teilnehmer:innen"} #{pluralDE n "ist" "sind"} bereits angemeldet
CourseParticipantsAlreadyTutorialMember n@Int: #{n} #{pluralDE n "Teinehmer:in" "Teilnehmer:innen"} #{pluralDE n "ist" "sind"} bereits in dieser Übungsgruppe angemeldet
CourseParticipantsRegistered n@Int: #{n} #{pluralDE n "Teinehmer:in" "Teilnehmer:innen"} erfolgreich angemeldet CourseParticipantsRegistered n@Int: #{n} #{pluralDE n "Teinehmer:in" "Teilnehmer:innen"} erfolgreich angemeldet
CourseApplicationText: Text-Bewerbung CourseApplicationText: Text-Bewerbung
CourseApplicationFollowInstructions: Beachten Sie die Anweisungen zur Bewerbung! CourseApplicationFollowInstructions: Beachten Sie die Anweisungen zur Bewerbung!

View File

@ -118,6 +118,7 @@ CourseParticipantsRegisterNoneGiven: No persons given to register!
CourseParticipantsInvited n: #{n} #{pluralEN n "invitation" "invitations"} sent via email CourseParticipantsInvited n: #{n} #{pluralEN n "invitation" "invitations"} sent via email
CourseParticipantsAddedByAvs n: #{n} AVS users successfully registered (TODO) CourseParticipantsAddedByAvs n: #{n} AVS users successfully registered (TODO)
CourseParticipantsAlreadyRegistered n: #{n} #{pluralEN n "participant is" "participants are"} already enrolled CourseParticipantsAlreadyRegistered n: #{n} #{pluralEN n "participant is" "participants are"} already enrolled
CourseParticipantsAlreadyTutorialMember n: #{n} #{pluralEN n "participant is" "participants are"} already registered for this tutorial
CourseParticipantsRegistered n: Successfully registered #{n} #{pluralEN n "participant" "participants"} CourseParticipantsRegistered n: Successfully registered #{n} #{pluralEN n "participant" "participants"}
CourseApplicationText: Application text CourseApplicationText: Application text
CourseApplicationFollowInstructions: Please follow the instructions for applications! CourseApplicationFollowInstructions: Please follow the instructions for applications!

View File

@ -90,14 +90,17 @@ addParticipantsResultMessages :: (MonadHandler m, HandlerSite m ~ UniWorX)
=> AddParticipantsResult => AddParticipantsResult
-> ReaderT (YesodPersistBackend UniWorX) m [Message] -> ReaderT (YesodPersistBackend UniWorX) m [Message]
addParticipantsResultMessages AddParticipantsResult{..} = execWriterT $ do addParticipantsResultMessages AddParticipantsResult{..} = execWriterT $ do
aurAlreadyRegistered' <- aurAlreadyRegistered' <- fmap sort (lift . mapM getJust $ Set.toList aurAlreadyRegistered)
fmap sort (lift . mapM (fmap userEmail . getJust) $ Set.toList aurAlreadyRegistered) aurAlreadyTutorialMember' <- fmap sort (lift . mapM getJust $ Set.toList aurAlreadyTutorialMember)
unless (null aurAlreadyRegistered) $ do unless (null aurAlreadyRegistered) $ do
let modalTrigger = [whamlet|_{MsgCourseParticipantsAlreadyRegistered (length aurAlreadyRegistered)}|] let modalTrigger = [whamlet|_{MsgCourseParticipantsAlreadyRegistered (length aurAlreadyRegistered)}|]
modalContent = $(widgetFile "messages/courseInvitationAlreadyRegistered") modalContent = $(widgetFile "messages/courseInvitationAlreadyRegistered")
tell . pure <=< messageWidget Info $ msgModal modalTrigger (Right modalContent) tell . pure <=< messageWidget Info $ msgModal modalTrigger (Right modalContent)
-- TODO: aurAlreadyTutorialMember unless (null aurAlreadyTutorialMember) $ do
let modalTrigger = [whamlet|_{MsgCourseParticipantsAlreadyTutorialMember (length aurAlreadyTutorialMember)}|]
modalContent = $(widgetFile "messages/courseInvitationAlreadyTutorialMember")
tell . pure <=< messageWidget Info $ msgModal modalTrigger (Right modalContent)
unless (null aurRegisterSuccess) $ unless (null aurRegisterSuccess) $
tell . pure <=< messageI Success . MsgCourseParticipantsRegistered $ length aurRegisterSuccess tell . pure <=< messageI Success . MsgCourseParticipantsRegistered $ length aurRegisterSuccess

View File

@ -1,12 +1,12 @@
$newline never $newline never
$# SPDX-FileCopyrightText: 2022 Gregor Kleen <gregor.kleen@ifi.lmu.de> $# SPDX-FileCopyrightText: 2022 Gregor Kleen <gregor.kleen@ifi.lmu.de>,Sarah Vaupel <sarah.vaupel@ifi.lmu.de>
$# $#
$# SPDX-License-Identifier: AGPL-3.0-or-later $# SPDX-License-Identifier: AGPL-3.0-or-later
<h2> <h2>
_{MsgCourseParticipantsAlreadyRegistered (length aurAlreadyRegistered)} _{MsgCourseParticipantsAlreadyRegistered (length aurAlreadyRegistered)}
<ul> <ul>
$forall email <- aurAlreadyRegistered' $forall registeredUser <- aurAlreadyRegistered'
<li .email> <li>
#{email} ^{userWidget registeredUser}

View File

@ -0,0 +1,12 @@
$newline never
$# SPDX-FileCopyrightText: 2022 Sarah Vaupel <sarah.vaupel@ifi.lmu.de>
$#
$# SPDX-License-Identifier: AGPL-3.0-or-later
<h2>
_{MsgCourseParticipantsAlreadyTutorialMember (length aurAlreadyTutorialMember)}
<ul>
$forall registeredUser <- aurAlreadyTutorialMember'
<li>
^{userWidget registeredUser}