fradrive/templates/participants-intersect.hamlet
2021-05-26 17:16:47 +02:00

37 lines
1.6 KiB
Plaintext

$newline never
<section>
^{formWidget}
$maybe (courses, intersections, mapIntersect, allUsersUnion, allUsersIntersection) <- intersectionsRes
<section>
<div .scrolltable .scrolltable--bordered>
<table .table .table--hover .table--condensed>
<thead>
<tr .table__row--head>
<th .table__th>
$forall Entity _ Course{courseTerm, courseSchool, courseShorthand} <- courses
<th .table__th .text--center>
#{courseTerm}-#{courseSchool}-#{courseShorthand}
<th .table__th .text--center>
_{MsgParticipantsIntersectNotOne}
<tbody>
$forall (l, Entity lCid Course{courseTerm, courseSchool, courseShorthand}) <- lIxed courses
<tr .table__row>
<th .table__th .text--right>
#{courseTerm}-#{courseSchool}-#{courseShorthand}
$forall (u, Entity uCid _) <- lIxed courses
$if l > u
<td .table__td>
$else
$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)}">
$if showNumber n lCid uCid
#{n}
$maybe num <- Map.lookup lCid mapIntersect
<td .table__td .text--center .table__td--automatic>
#{num}
<p>
_{MsgAllUsersUnion}: #
#{allUsersUnion}
<p>
_{MsgAllUsersIntersection}: #
#{allUsersIntersection}