feat(participants): first finished verson
This commit is contained in:
parent
3b20ec27aa
commit
0a3fd23e22
@ -5,4 +5,6 @@ ParticipantsIntersectCourseOption tid@TermId ssh@SchoolId coursen@CourseName !id
|
|||||||
ParticipantsIntersectCourses: Kurse
|
ParticipantsIntersectCourses: Kurse
|
||||||
CourseParticipantsRegisteredWithoutField n@Int: #{n} #{pluralDE n "Teilnehmeri:in wurde ohne assoziiertes Studienfach" "Teilnehmer:innen wurden ohne assoziierte Studienfächer"} angemeldet, da #{pluralDE n "kein eindeutiges Hauptfach bestimmt werden konnte" "keine eindeutigen Hauptfächer bestimmt werden konnten"}
|
CourseParticipantsRegisteredWithoutField n@Int: #{n} #{pluralDE n "Teilnehmeri:in wurde ohne assoziiertes Studienfach" "Teilnehmer:innen wurden ohne assoziierte Studienfächer"} angemeldet, da #{pluralDE n "kein eindeutiges Hauptfach bestimmt werden konnte" "keine eindeutigen Hauptfächer bestimmt werden konnten"}
|
||||||
ParticipantsCsvSheetName tid@TermId ssh@SchoolId: #{foldCase (termToText (unTermKey tid))}-#{foldedCase (unSchoolKey ssh)} Kursteilnehmer:innen
|
ParticipantsCsvSheetName tid@TermId ssh@SchoolId: #{foldCase (termToText (unTermKey tid))}-#{foldedCase (unSchoolKey ssh)} Kursteilnehmer:innen
|
||||||
CourseParticipants n@Int: Derzeit #{n} angemeldete Kursteilnehmer:innen
|
CourseParticipants n@Int: Derzeit #{n} angemeldete Kursteilnehmer:innen
|
||||||
|
ParticipantsIntersectNotOne: Schnitt
|
||||||
|
AllUsers: Vereinigung aller Teilnehmer:innen:
|
||||||
@ -6,3 +6,5 @@ ParticipantsIntersectCourses: Courses
|
|||||||
CourseParticipantsRegisteredWithoutField n: #{n} #{pluralEN n "participant was" "participants were"} registered without #{pluralEN n "an associated field of study" "associated fields of study"}, because #{pluralEN n "it" "they"} could not be determined uniquely.
|
CourseParticipantsRegisteredWithoutField n: #{n} #{pluralEN n "participant was" "participants were"} registered without #{pluralEN n "an associated field of study" "associated fields of study"}, because #{pluralEN n "it" "they"} could not be determined uniquely.
|
||||||
ParticipantsCsvSheetName tid ssh: #{foldCase (termToText (unTermKey tid))}-#{foldedCase (unSchoolKey ssh)} Participants
|
ParticipantsCsvSheetName tid ssh: #{foldCase (termToText (unTermKey tid))}-#{foldedCase (unSchoolKey ssh)} Participants
|
||||||
CourseParticipants n: Currently #{n} course #{pluralEN n "participant" "participants"}
|
CourseParticipants n: Currently #{n} course #{pluralEN n "participant" "participants"}
|
||||||
|
ParticipantsIntersectNotOne: Intersection
|
||||||
|
AllUsers: Union of all participants:
|
||||||
@ -708,4 +708,3 @@ addPWEntry User{ userAuthentication = _, ..} (Text.encodeUtf8 -> pw) = db' $ do
|
|||||||
PWHashConf{..} <- getsYesod $ view _appAuthPWHash
|
PWHashConf{..} <- getsYesod $ view _appAuthPWHash
|
||||||
(AuthPWHash . Text.decodeUtf8 -> userAuthentication) <- liftIO $ makePasswordWith pwHashAlgorithm pw pwHashStrength
|
(AuthPWHash . Text.decodeUtf8 -> userAuthentication) <- liftIO $ makePasswordWith pwHashAlgorithm pw pwHashStrength
|
||||||
void $ insert User{..}
|
void $ insert User{..}
|
||||||
|
|
||||||
|
|||||||
@ -110,9 +110,9 @@ postParticipantsIntersectR = do
|
|||||||
-> Set.size $ Map.findWithDefault Set.empty lCid courseUsers `Set.intersection` Map.findWithDefault Set.empty uCid courseUsers
|
-> Set.size $ Map.findWithDefault Set.empty lCid courseUsers `Set.intersection` Map.findWithDefault Set.empty uCid courseUsers
|
||||||
selfIntersections = Map.mapKeysMonotonic (\cid -> (cid, cid)) $ Set.size <$> courseUsers
|
selfIntersections = Map.mapKeysMonotonic (\cid -> (cid, cid)) $ Set.size <$> courseUsers
|
||||||
intersections' = Map.union intersections selfIntersections
|
intersections' = Map.union intersections selfIntersections
|
||||||
-- let allUsers = setUnionAll $ Map.elems courseUsers
|
let allUsers = setUnionAll $ Map.elems courseUsers
|
||||||
-- let mapIntersect = mapIntersectNotOne courseUsers
|
let mapIntersect = mapIntersectNotOne courseUsers
|
||||||
return (courses, intersections')
|
return (courses, intersections', mapIntersect, allUsers)
|
||||||
|
|
||||||
let
|
let
|
||||||
symmIntersection intersections lCid uCid = fromMaybe 0 $ intersections !? (lCid, uCid) <|> intersections !? (uCid, lCid)
|
symmIntersection intersections lCid uCid = fromMaybe 0 $ intersections !? (lCid, uCid) <|> intersections !? (uCid, lCid)
|
||||||
|
|||||||
@ -36,7 +36,10 @@ setUnionOthers [] = Set.empty
|
|||||||
setUnionOthers [x] = x
|
setUnionOthers [x] = x
|
||||||
setUnionOthers (x:y:z) = setUnionOthers (xy:z) where xy = Set.union x y
|
setUnionOthers (x:y:z) = setUnionOthers (xy:z) where xy = Set.union x y
|
||||||
|
|
||||||
-- Fkt für Tabelle
|
----------------------------------
|
||||||
|
-- Functions fro Particiants.hs --
|
||||||
|
----------------------------------
|
||||||
|
|
||||||
-- | list of values of a Map with Sets as values
|
-- | list of values of a Map with Sets as values
|
||||||
getAllUserIdsSetList :: Map.Map a (Set b) -> [Set b]
|
getAllUserIdsSetList :: Map.Map a (Set b) -> [Set b]
|
||||||
getAllUserIdsSetList m = loop (Map.toList m) [] where
|
getAllUserIdsSetList m = loop (Map.toList m) [] where
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
$newline never
|
$newline never
|
||||||
<section>
|
<section>
|
||||||
^{formWidget}
|
^{formWidget}
|
||||||
$maybe (courses, intersections) <- intersectionsRes
|
$maybe (courses, intersections, mapIntersect, allUsers) <- intersectionsRes
|
||||||
<section>
|
<section>
|
||||||
<div .scrolltable .scrolltable--bordered>
|
<div .scrolltable .scrolltable--bordered>
|
||||||
<table .table .table--hover .table--condensed>
|
<table .table .table--hover .table--condensed>
|
||||||
@ -11,6 +11,8 @@ $maybe (courses, intersections) <- intersectionsRes
|
|||||||
$forall Entity _ Course{courseTerm, courseSchool, courseShorthand} <- courses
|
$forall Entity _ Course{courseTerm, courseSchool, courseShorthand} <- courses
|
||||||
<th .table__th .text--center>
|
<th .table__th .text--center>
|
||||||
#{courseTerm}-#{courseSchool}-#{courseShorthand}
|
#{courseTerm}-#{courseSchool}-#{courseShorthand}
|
||||||
|
<th .table__th .text--center>
|
||||||
|
_{MsgParticipantsIntersectNotOne}
|
||||||
<tbody>
|
<tbody>
|
||||||
$forall (l, Entity lCid Course{courseTerm, courseSchool, courseShorthand}) <- lIxed courses
|
$forall (l, Entity lCid Course{courseTerm, courseSchool, courseShorthand}) <- lIxed courses
|
||||||
<tr .table__row>
|
<tr .table__row>
|
||||||
@ -23,4 +25,10 @@ $maybe (courses, intersections) <- intersectionsRes
|
|||||||
$with n <- symmIntersection intersections lCid uCid
|
$with n <- symmIntersection intersections lCid uCid
|
||||||
<td .table__td .text--center :uCid == lCid:.table__td--automatic :uCid /= lCid:.heated :uCid /= lCid:style="--hotness: #{toPathPiece (intersectionHotness intersections lCid uCid)}">
|
<td .table__td .text--center :uCid == lCid:.table__td--automatic :uCid /= lCid:.heated :uCid /= lCid:style="--hotness: #{toPathPiece (intersectionHotness intersections lCid uCid)}">
|
||||||
$if showNumber n lCid uCid
|
$if showNumber n lCid uCid
|
||||||
#{n}
|
#{n}
|
||||||
|
$maybe num <- Map.lookup lCid mapIntersect
|
||||||
|
<td .table__td .text--center .table__td--automatic>
|
||||||
|
#{num}
|
||||||
|
<p>
|
||||||
|
_{MsgAllUsers}
|
||||||
|
#{allUsers}
|
||||||
Reference in New Issue
Block a user