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>
|
2019-04-20 23:29:59 +02:00
|
|
|
{{#if this.hasTimes}}
|
|
|
|
<tr>
|
|
|
|
<th>
|
2023-09-21 12:30:14 +02:00
|
|
|
{{! column for name }}
|
2019-04-20 23:29:59 +02:00
|
|
|
</th>
|
|
|
|
{{#each this.optionsGroupedByDays as |optionGroup|}}
|
2018-12-29 20:35:04 +01:00
|
|
|
<th colspan={{optionGroup.items.length}}>
|
2023-09-21 12:30:14 +02:00
|
|
|
{{!
|
|
|
|
TODO: Simplify to dateStyle="full" after upgrading to Ember Intl v6
|
2023-10-01 16:21:49 +02:00
|
|
|
|
|
|
|
Cannot use optionGroup.value because that's a ISO8601 day string
|
|
|
|
(e.g. "2023-10-01"), which is parsed by browsers in UTC and not
|
|
|
|
locale time zone. Therefore we need parse a JS Date representation
|
|
|
|
of that string, which has been parsed by Luxon in correct timezone.
|
2023-09-21 12:30:14 +02:00
|
|
|
}}
|
|
|
|
{{format-date
|
2023-10-01 16:21:49 +02:00
|
|
|
optionGroup.items.0.jsDate
|
2023-09-21 12:30:14 +02:00
|
|
|
weekday="long"
|
|
|
|
day="numeric"
|
|
|
|
month="long"
|
|
|
|
year="numeric"
|
|
|
|
}}
|
2016-08-11 23:37:14 +02:00
|
|
|
</th>
|
|
|
|
{{/each}}
|
|
|
|
</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>
|
|
|
|
{{#each this.options as |option|}}
|
2017-07-31 16:52:27 +02:00
|
|
|
<th>
|
2019-04-20 23:29:59 +02:00
|
|
|
{{#if (and this.isFindADate this.hasTimes)}}
|
|
|
|
{{#if option.hasTime}}
|
2023-09-21 12:30:14 +02:00
|
|
|
{{!
|
|
|
|
TODO: Simplify to timeStyle="short" after upgrading to Ember Intl v6
|
|
|
|
}}
|
2023-10-01 16:21:49 +02:00
|
|
|
{{format-date option.jsDate hour="numeric" minute="numeric"}}
|
2016-08-11 23:37:14 +02:00
|
|
|
{{/if}}
|
2019-04-20 23:29:59 +02:00
|
|
|
{{else if this.isFindADate}}
|
2023-09-21 12:30:14 +02:00
|
|
|
{{!
|
|
|
|
TODO: Simplify to dateStyle="full" after upgrading to Ember Intl v6
|
|
|
|
}}
|
|
|
|
{{format-date
|
|
|
|
option.jsDate
|
|
|
|
weekday="long"
|
|
|
|
day="numeric"
|
|
|
|
month="long"
|
|
|
|
year="numeric"
|
|
|
|
}}
|
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>
|
|
|
|
{{#each this.options as |option index|}}
|
2019-11-10 17:44:44 +01:00
|
|
|
{{#let (object-at index user.selections) as |selection|}}
|
|
|
|
<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>
|