fradrive/templates/news/activeAllocations.hamlet
2022-10-12 09:35:16 +02:00

60 lines
3.1 KiB
Plaintext

$newline never
$# SPDX-FileCopyrightText: 2022 Gregor Kleen <gregor.kleen@ifi.lmu.de>
$#
$# SPDX-License-Identifier: AGPL-3.0-or-later
<section .news__active-allocations>
<h2>_{MsgNewsActiveAllocations}
<div .active-allocations__wrapper>
$forall allocs@(NonEmpty (Entity cId cAlloc, _) oldAllocs) <- toList activeAllocs
$with (tid, ssh, ash) <- (allocationTerm cAlloc, allocationSchool cAlloc, allocationShorthand cAlloc)
<div .active-allocations__allocation>
<a href=@{AllocationR tid ssh ash AShowR} .active-allocations__allocation-ident>
#{toPathPiece tid}
-
#{ssh}
-
#{ash}
<a href=@{AllocationR tid ssh ash AShowR} .active-allocations__allocation-name>
#{allocationName cAlloc}
$maybe tWidget <- allocTime cAlloc
<div .active-allocations__allocation-time>
^{tWidget}
<table .active-allocations__allocation-info .table .table--hover .table--condensed>
$if not (null oldAllocs)
<thead>
<tr .table__row--head>
<td>
$forall (Entity aId alloc, _) <- allocsToList allocs
<th .table__th .table__th--bright :aId == cId:.active-allocations__allocation-info-item--current :aId /= cId:.active-allocations__allocation-info-item--old>
#{toPathPiece (allocationTerm alloc)}
<tbody>
<tr .table__row>
<th .table__th .table__th--bright>
_{MsgNewsActiveAllocationsPlaces}
$forall (Entity aId _, allocInfo) <- allocsToList allocs
<td .table__td :aId == cId:.active-allocations__allocation-info-item--current :aId /= cId:.active-allocations__allocation-info-item--old>
#{auiPlaces allocInfo}
<tr .table__row>
<th .table__th .table__th--bright>
_{MsgNewsActiveAllocationsApplicants}
$forall (Entity aId _, allocInfo) <- allocsToList allocs
<td .table__td :aId == cId:.active-allocations__allocation-info-item--current :aId /= cId:.active-allocations__allocation-info-item--old>
#{auiApplicants allocInfo}
<tr .table__row>
<th .table__th .table__th--bright>
_{MsgNewsActiveAllocationsPlacementsMade}
$forall (Entity aId _, allocInfo) <- allocsToList allocs
<td .table__td :aId == cId:.active-allocations__allocation-info-item--current :aId /= cId:.active-allocations__allocation-info-item--old>
#{auiPlacementsMade allocInfo}
<tr .table__row>
<th .table__th .table__th--bright>
_{MsgNewsActiveAllocationsApplicantsPlaced}
$forall (Entity aId _, allocInfo) <- allocsToList allocs
<td .table__td :aId == cId:.active-allocations__allocation-info-item--current :aId /= cId:.active-allocations__allocation-info-item--old>
#{auiApplicantsPlaced allocInfo}
^{allocationInfo}