|
1 | 1 | {{#if @studentList}} |
2 | 2 |
|
3 | | - <PixBlock class="add-student-list"> |
4 | | - <div class="add-student-list__filters"> |
5 | | - <span>{{t "pages.sco.enrol-candidates-in-session.list.table.filter.title"}}</span> |
6 | | - <PixMultiSelect |
7 | | - @emptyMessage={{this.emptyMessage}} |
8 | | - @id="add-student-list__multi-select" |
9 | | - @onChange={{this.selectDivision}} |
10 | | - @placeholder={{t "pages.sco.enrol-candidates-in-session.list.table.filter.placeholder"}} |
11 | | - @isSearchable={{true}} |
12 | | - @screenReaderOnly={{true}} |
13 | | - @values={{this.selectedDivisions}} |
14 | | - @options={{@certificationCenterDivisions}} |
15 | | - > |
16 | | - <:label>{{t "pages.sco.enrol-candidates-in-session.list.table.filter.extra-information"}}</:label> |
17 | | - <:default as |option|>{{option.label}}</:default> |
18 | | - </PixMultiSelect> |
19 | | - </div> |
| 3 | + <div class="add-student-list__filters"> |
| 4 | + <span>{{t "pages.sco.enrol-candidates-in-session.list.table.filter.title"}}</span> |
| 5 | + <PixMultiSelect |
| 6 | + @emptyMessage={{this.emptyMessage}} |
| 7 | + @id="add-student-list__multi-select" |
| 8 | + @onChange={{this.selectDivision}} |
| 9 | + @placeholder={{t "pages.sco.enrol-candidates-in-session.list.table.filter.placeholder"}} |
| 10 | + @isSearchable={{true}} |
| 11 | + @screenReaderOnly={{true}} |
| 12 | + @values={{this.selectedDivisions}} |
| 13 | + @options={{@certificationCenterDivisions}} |
| 14 | + > |
| 15 | + <:label>{{t "pages.sco.enrol-candidates-in-session.list.table.filter.extra-information"}}</:label> |
| 16 | + <:default as |option|>{{option.label}}</:default> |
| 17 | + </PixMultiSelect> |
| 18 | + </div> |
20 | 19 |
|
21 | | - <div class="table"> |
22 | | - <table> |
23 | | - <thead> |
24 | | - <tr> |
25 | | - <th class="table__column--checkbox"> |
26 | | - <PixCheckbox |
27 | | - @screenReaderOnly={{true}} |
28 | | - @class="add-student-list__checker" |
29 | | - @isIndeterminate={{this.hasPartialState}} |
30 | | - @checked={{this.hasCheckState}} |
31 | | - {{on "click" this.toggleAllItems}} |
32 | | - disabled={{this.isDisabled}} |
33 | | - > |
34 | | - <:label>{{t "pages.candidates.add.actions.select-all.label"}}</:label> |
35 | | - </PixCheckbox> |
36 | | - </th> |
37 | | - <th class="table__column--medium">{{t "pages.sco.enrol-candidates-in-session.list.table.division"}}</th> |
38 | | - <th class="table__column--medium">{{t "pages.sco.enrol-candidates-in-session.list.table.last-name"}}</th> |
39 | | - <th class="table__column--medium">{{t "pages.sco.enrol-candidates-in-session.list.table.first-name"}}</th> |
40 | | - <th class="add-student-list__column-birthdate"> |
41 | | - {{t "pages.sco.enrol-candidates-in-session.list.table.birthdate"}} |
42 | | - </th> |
43 | | - </tr> |
44 | | - </thead> |
45 | | - <tbody> |
46 | | - {{#each @studentList as |student|}} |
47 | | - {{#if student.isEnrolled}} |
48 | | - <tr class="add-student-list__row add-student-list__row--disabled"> |
49 | | - <td> |
50 | | - <PixCheckbox @screenReaderOnly={{true}} @class="add-student-list__checker" @checked={{true}} disabled> |
51 | | - <:label> |
52 | | - {{t |
53 | | - "pages.candidates.add.actions.selected.label" |
54 | | - firstName=student.firstName |
55 | | - lastName=student.lastName |
56 | | - }} |
57 | | - </:label> |
58 | | - </PixCheckbox> |
59 | | - </td> |
60 | | - <td>{{student.division}}</td> |
61 | | - <td>{{student.lastName}}</td> |
62 | | - <td>{{student.firstName}}</td> |
63 | | - <td>{{dayjs-format student.birthdate "DD/MM/YYYY"}}</td> |
64 | | - </tr> |
65 | | - {{else}} |
66 | | - <tr class="add-student-list__row" {{on "click" (fn this.toggleItem student)}}> |
67 | | - <td> |
68 | | - <PixCheckbox @screenReaderOnly={{true}} @checked={{student.isSelected}}> |
69 | | - <:label> |
70 | | - {{t |
71 | | - "pages.candidates.add.actions.select.label" |
72 | | - firstName=student.firstName |
73 | | - lastName=student.lastName |
74 | | - }} |
75 | | - </:label> |
76 | | - </PixCheckbox> |
77 | | - </td> |
78 | | - <td>{{student.division}}</td> |
79 | | - <td>{{student.lastName}}</td> |
80 | | - <td>{{student.firstName}}</td> |
81 | | - <td class="add-student-list__column-birthdate">{{dayjs-format student.birthdate "DD/MM/YYYY"}}</td> |
82 | | - </tr> |
83 | | - {{/if}} |
84 | | - {{/each}} |
85 | | - </tbody> |
86 | | - </table> |
87 | | - </div> |
88 | | - </PixBlock> |
| 20 | + <PixTable @data={{@studentList}} @variant="certif"> |
| 21 | + <:columns as |student context|> |
| 22 | + <PixTableColumn @context={{context}}> |
| 23 | + <:header> |
| 24 | + <PixCheckbox |
| 25 | + @screenReaderOnly={{true}} |
| 26 | + @isIndeterminate={{this.hasPartialState}} |
| 27 | + @checked={{this.hasCheckState}} |
| 28 | + {{on "click" this.toggleAllItems}} |
| 29 | + disabled={{this.isDisabled}} |
| 30 | + > |
| 31 | + <:label>{{t "pages.candidates.add.actions.select-all.label"}}</:label> |
| 32 | + </PixCheckbox> |
| 33 | + </:header> |
| 34 | + <:cell> |
| 35 | + <PixCheckbox |
| 36 | + @screenReaderOnly={{true}} |
| 37 | + @checked={{or student.isSelected student.isEnrolled}} |
| 38 | + disabled={{student.isEnrolled}} |
| 39 | + {{on "click" (fn this.toggleItem student)}} |
| 40 | + > |
| 41 | + <:label> |
| 42 | + {{#if student.isEnrolled}} |
| 43 | + {{t |
| 44 | + "pages.candidates.add.actions.selected.label" |
| 45 | + firstName=student.firstName |
| 46 | + lastName=student.lastName |
| 47 | + }} |
| 48 | + {{else}} |
| 49 | + {{t "pages.candidates.add.actions.select.label" firstName=student.firstName lastName=student.lastName}} |
| 50 | + {{/if}} |
| 51 | + </:label> |
| 52 | + </PixCheckbox> |
| 53 | + </:cell> |
| 54 | + </PixTableColumn> |
| 55 | + <PixTableColumn @context={{context}}> |
| 56 | + <:header> |
| 57 | + {{t "pages.sco.enrol-candidates-in-session.list.table.division"}} |
| 58 | + </:header> |
| 59 | + <:cell> |
| 60 | + {{student.division}} |
| 61 | + </:cell> |
| 62 | + </PixTableColumn> |
| 63 | + <PixTableColumn @context={{context}}> |
| 64 | + <:header> |
| 65 | + {{t "pages.sco.enrol-candidates-in-session.list.table.last-name"}} |
| 66 | + </:header> |
| 67 | + <:cell> |
| 68 | + {{student.lastName}} |
| 69 | + </:cell> |
| 70 | + </PixTableColumn> |
| 71 | + <PixTableColumn @context={{context}}> |
| 72 | + <:header> |
| 73 | + {{t "pages.sco.enrol-candidates-in-session.list.table.first-name"}} |
| 74 | + </:header> |
| 75 | + <:cell> |
| 76 | + {{student.firstName}} |
| 77 | + </:cell> |
| 78 | + </PixTableColumn> |
| 79 | + <PixTableColumn @context={{context}}> |
| 80 | + <:header> |
| 81 | + {{t "pages.sco.enrol-candidates-in-session.list.table.birthdate"}} |
| 82 | + </:header> |
| 83 | + <:cell> |
| 84 | + {{dayjs-format student.birthdate "DD/MM/YYYY"}} |
| 85 | + </:cell> |
| 86 | + </PixTableColumn> |
| 87 | + </:columns> |
| 88 | + </PixTable> |
89 | 89 |
|
90 | 90 | <PixPagination @pagination={{@studentList.meta}} /> |
91 | 91 |
|
|
0 commit comments