|
1 | 1 | @using DigitalLearningSolutions.Web.ViewModels.Common |
2 | 2 | @model ActivityTableViewModel |
3 | 3 | @{ |
4 | | - const int defaultNumOfRowsVisible = 5; |
| 4 | + const int defaultNumOfRowsVisible = 5; |
5 | 5 |
|
6 | | - //These must match with the name in trackingSystem/reports.ts |
7 | | - const string toggleableActivityButtonId = "js-toggle-row-button"; |
8 | | - const string toggleableActivityRowClass = "js-toggleable-activity-row"; |
| 6 | + //These must match with the name in trackingSystem/reports.ts |
| 7 | + const string toggleableActivityButtonId = "js-toggle-row-button"; |
| 8 | + const string toggleableActivityRowClass = "js-toggleable-activity-row"; |
9 | 9 | } |
10 | 10 |
|
11 | 11 | <table role="table" class="nhsuk-table-responsive"> |
12 | | - <thead role="rowgroup" class="nhsuk-table__head"> |
13 | | - <tr role="row"> |
14 | | - <th role="columnheader" scope="col"> |
15 | | - Period |
16 | | - </th> |
17 | | - <th role="columnheader" scope="col"> |
18 | | - Registrations |
19 | | - </th> |
20 | | - <th role="columnheader" scope="col"> |
21 | | - Completions |
22 | | - </th> |
23 | | - <th role="columnheader" scope="col"> |
24 | | - Evaluations |
25 | | - </th> |
26 | | - </tr> |
27 | | - </thead> |
28 | | - <tbody class="nhsuk-table__body"> |
29 | | - @foreach (var (activityRow, rowNumber) in Model.Rows.Select((row, index) => (row, index + 1))) |
30 | | - { |
31 | | - <tr role="row" class="nhsuk-table__row @(rowNumber > defaultNumOfRowsVisible ? toggleableActivityRowClass : string.Empty)"> |
32 | | - <td role="cell" class="nhsuk-table__cell"> |
33 | | - <span class="nhsuk-table-responsive__heading">Period </span>@activityRow.Period |
34 | | - </td> |
35 | | - <td role="cell" class="nhsuk-table__cell"> |
36 | | - <span class="nhsuk-table-responsive__heading">Registrations </span>@activityRow.Registrations |
37 | | - </td> |
38 | | - <td role="cell" class="nhsuk-table__cell"> |
39 | | - <span class="nhsuk-table-responsive__heading">Completions </span>@activityRow.Completions |
40 | | - </td> |
41 | | - <td role="cell" class="nhsuk-table__cell"> |
42 | | - <span class="nhsuk-table-responsive__heading">Evaluations </span>@activityRow.Evaluations |
43 | | - </td> |
44 | | - </tr> |
45 | | - } |
46 | | - </tbody> |
| 12 | + <thead role="rowgroup" class="nhsuk-table__head"> |
| 13 | + <tr role="row"> |
| 14 | + <th role="columnheader" scope="col"> |
| 15 | + Period |
| 16 | + </th> |
| 17 | + <th role="columnheader" scope="col"> |
| 18 | + Registrations |
| 19 | + </th> |
| 20 | + <th role="columnheader" scope="col"> |
| 21 | + Completions |
| 22 | + </th> |
| 23 | + <th role="columnheader" scope="col"> |
| 24 | + Evaluations |
| 25 | + </th> |
| 26 | + </tr> |
| 27 | + </thead> |
| 28 | + <tbody class="nhsuk-table__body"> |
| 29 | + @foreach (var (activityRow, rowNumber) in Model.Rows.Select((row, index) => (row, index + 1))) |
| 30 | + { |
| 31 | + <tr role="row" class="nhsuk-table__row @(rowNumber > defaultNumOfRowsVisible ? toggleableActivityRowClass : string.Empty)"> |
| 32 | + <td role="cell" class="nhsuk-table__cell"> |
| 33 | + <span class="nhsuk-table-responsive__heading">Period </span>@activityRow.Period |
| 34 | + </td> |
| 35 | + <td role="cell" class="nhsuk-table__cell"> |
| 36 | + <span class="nhsuk-table-responsive__heading">Registrations </span>@activityRow.Registrations |
| 37 | + </td> |
| 38 | + <td role="cell" class="nhsuk-table__cell"> |
| 39 | + <span class="nhsuk-table-responsive__heading">Completions </span>@activityRow.Completions |
| 40 | + </td> |
| 41 | + <td role="cell" class="nhsuk-table__cell"> |
| 42 | + <span class="nhsuk-table-responsive__heading">Evaluations </span>@activityRow.Evaluations |
| 43 | + </td> |
| 44 | + </tr> |
| 45 | + } |
| 46 | + </tbody> |
47 | 47 | </table> |
48 | 48 |
|
49 | | -<div class="nhsuk-u-margin-top-4"> |
50 | | - <a id="@(toggleableActivityButtonId)" |
51 | | - role="button" |
52 | | - class="nhsuk-u-margin-top-4 js-only-inline" |
53 | | - href="#"> |
54 | | - View more |
55 | | - </a> |
56 | | -</div> |
| 49 | +@if (Model.Rows.Count() > defaultNumOfRowsVisible) |
| 50 | +{ |
| 51 | + <div class="nhsuk-u-margin-top-4"> |
| 52 | + <a id="@(toggleableActivityButtonId)" |
| 53 | + role="button" |
| 54 | + class="nhsuk-u-margin-top-4 js-only-inline" |
| 55 | + href="#"> |
| 56 | + View more |
| 57 | + </a> |
| 58 | + </div> |
| 59 | +} |
0 commit comments