2019-04-20 23:29:59 +02:00
|
|
|
<div class="participants-table">
|
2023-09-21 12:30:14 +02:00
|
|
|
<table class="table" data-test-table-of="participants">
|
2016-08-11 23:37:14 +02:00
|
|
|
<thead>
|
2023-10-15 17:32:11 +02:00
|
|
|
{{#if @poll.hasTimes}}
|
2019-04-20 23:29:59 +02:00
|
|
|
<tr>
|
|
|
|
<th>
|
2023-09-21 12:30:14 +02:00
|
|
|
{{! column for name }}
|
2019-04-20 23:29:59 +02:00
|
|
|
</th>
|
2023-10-15 17:32:11 +02:00
|
|
|
{{#each-in this.optionsPerDay as |jsDate count|}}
|
2023-11-04 14:54:30 +01:00
|
|
|
{{!
|
|
|
|
@glint-ignore
|
|
|
|
We can be sure that count is a number because it is destructed from a
|
|
|
|
Map, which values are only numbers. But somehow Glint / TypeScript
|
|
|
|
is not sure about it.
|
|
|
|
}}
|
2023-10-15 17:32:11 +02:00
|
|
|
<th colspan={{count}}>
|
2023-11-04 17:21:35 +01:00
|
|
|
{{format-date jsDate dateStyle="full" timeZone=@timeZone}}
|
2016-08-11 23:37:14 +02:00
|
|
|
</th>
|
2023-10-15 17:32:11 +02:00
|
|
|
{{/each-in}}
|
2016-08-11 23:37:14 +02:00
|
|
|
</tr>
|
|
|
|
{{/if}}
|
2019-04-20 23:29:59 +02:00
|
|
|
|
2016-08-11 23:37:14 +02:00
|
|
|
<tr>
|
2019-04-20 23:29:59 +02:00
|
|
|
<th>
|
2023-09-21 12:30:14 +02:00
|
|
|
{{! column for name }}
|
2019-04-20 23:29:59 +02:00
|
|
|
</th>
|
2023-10-15 17:32:11 +02:00
|
|
|
{{#each @poll.options as |option|}}
|
2017-07-31 16:52:27 +02:00
|
|
|
<th>
|
2023-10-15 17:32:11 +02:00
|
|
|
{{#if (and @poll.isFindADate @poll.hasTimes)}}
|
2019-04-20 23:29:59 +02:00
|
|
|
{{#if option.hasTime}}
|
2023-09-21 12:30:14 +02:00
|
|
|
{{!
|
2023-11-04 14:54:30 +01:00
|
|
|
@glint-ignore
|
|
|
|
Narrowring is not working here correctly. Due to the only executing if
|
|
|
|
`option.hasTime` is `true`, we know that `option.jsDate` cannot be `null`.
|
|
|
|
But TypeScript does not support narrowing through a chain of getters
|
|
|
|
currently.
|
2023-09-21 12:30:14 +02:00
|
|
|
}}
|
2023-11-04 17:21:35 +01:00
|
|
|
{{! @glint-ignore }}{{! prettier-ignore }}
|
|
|
|
{{format-date option.jsDate
|
|
|
|
timeStyle="short"
|
|
|
|
timeZone=@timeZone
|
|
|
|
}}
|
2016-08-11 23:37:14 +02:00
|
|
|
{{/if}}
|
2023-10-15 17:32:11 +02:00
|
|
|
{{else if @poll.isFindADate}}
|
2023-09-21 12:30:14 +02:00
|
|
|
{{!
|
2023-11-04 14:54:30 +01:00
|
|
|
@glint-ignore
|
|
|
|
Narrowring is not working here correctly. Due to the only executing if
|
|
|
|
`option.hasTime` is `true`, we know that `option.jsDate` cannot be `null`.
|
|
|
|
But TypeScript does not support narrowing through a chain of getters
|
|
|
|
currently.
|
2023-09-21 12:30:14 +02:00
|
|
|
}}
|
2023-11-04 17:21:35 +01:00
|
|
|
{{format-date option.jsDate dateStyle="full" timeZone=@timeZone}}
|
2017-07-31 16:52:27 +02:00
|
|
|
{{else}}
|
2016-08-11 23:37:14 +02:00
|
|
|
{{option.title}}
|
2017-07-31 16:52:27 +02:00
|
|
|
{{/if}}
|
|
|
|
</th>
|
|
|
|
{{/each}}
|
2016-08-11 23:37:14 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2019-04-20 23:29:59 +02:00
|
|
|
{{#each this.usersSorted as |user|}}
|
|
|
|
<tr data-test-participant={{user.id}}>
|
2023-09-21 12:30:14 +02:00
|
|
|
<td data-test-value-for="name">
|
2019-04-20 23:29:59 +02:00
|
|
|
{{user.name}}
|
|
|
|
</td>
|
2023-10-15 17:32:11 +02:00
|
|
|
{{#each @poll.options as |option index|}}
|
2023-11-04 14:54:30 +01:00
|
|
|
{{#let (get user.selections index) as |selection|}}
|
2019-11-10 17:44:44 +01:00
|
|
|
<td
|
|
|
|
class={{selection.type}}
|
|
|
|
data-test-is-selection-cell
|
2023-10-01 16:21:49 +02:00
|
|
|
data-test-value-for={{option.title}}
|
2019-11-10 17:44:44 +01:00
|
|
|
>
|
|
|
|
{{#if selection.labelTranslation}}
|
|
|
|
{{t selection.labelTranslation}}
|
2019-04-20 23:29:59 +02:00
|
|
|
{{else}}
|
2019-11-10 17:44:44 +01:00
|
|
|
{{selection.label}}
|
2016-08-11 23:37:14 +02:00
|
|
|
{{/if}}
|
2019-11-10 17:44:44 +01:00
|
|
|
</td>
|
|
|
|
{{/let}}
|
2016-08-11 23:37:14 +02:00
|
|
|
{{/each}}
|
|
|
|
</tr>
|
|
|
|
{{/each}}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2019-04-20 23:29:59 +02:00
|
|
|
</div>
|