-
Notifications
You must be signed in to change notification settings - Fork 1
HEEDLS-871 Add category topic tags and fix incorrect behaviour #1098
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ce86170
9892172
8164e4e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,6 +87,11 @@ public static string GetTimeStringFromMinutes(int minutes) | |
| return minutes < 60 ? $"{minutes}m" : $"{minutes / 60}h {minutes % 60}m"; | ||
| } | ||
|
|
||
| public static string GetTimeStringForScreenReaderFromMinutes(int minutes) | ||
| { | ||
| return minutes < 60 ? $"{minutes} minutes" : $"{minutes / 60} hours {minutes % 60} minutes"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just double checking, I'm guessing we are fine with "1 hour 0 minutes" rather than going for just "1 hour" whenever we have a whole number of hours? Same sort of question would apply to the tag content of "1h 0m". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's fine where we have data down to the minute. Also the old site displays these as 1h 0m, and it's been to show and tell. |
||
| } | ||
|
|
||
| public static string AddSpacesToPascalCaseString(string pascalCaseString) | ||
| { | ||
| return PascalRegex.Replace(pascalCaseString, " "); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,8 +12,17 @@ | |
|
|
||
| <div class="nhsuk-details__text"> | ||
| <div class="tags"> | ||
| <div class="card-filter-tag" data-filter-value="@Model.CategoryFilter"> | ||
| <strong class="nhsuk-tag nhsuk-tag--grey">@Model.CategoryName</strong> | ||
| </div> | ||
|
|
||
| <div class="card-filter-tag" data-filter-value="@Model.TopicFilter"> | ||
| <strong class="nhsuk-tag nhsuk-tag--grey">@Model.CourseTopic</strong> | ||
| </div> | ||
|
|
||
| <div class="card-filter-tag"> | ||
| <strong class="nhsuk-tag nhsuk-tag--grey">@Model.DisplayTime</strong> | ||
| <strong class="nhsuk-tag nhsuk-tag--grey" aria-hidden="true">@Model.DisplayTime</strong> | ||
| <span class="nhsuk-u-visually-hidden">Length @Model.TimeForScreenReader</span> | ||
| <span hidden name="learning-time">@Model.Time</span> | ||
| </div> | ||
|
|
||
|
|
@@ -22,29 +31,24 @@ | |
| <span hidden name="popularity-score">@Model.PopularityRating</span> | ||
| </div> | ||
| </div> | ||
| <span hidden data-filter-value="@Model.CategoryFilter"> | ||
| @Model.CategoryName | ||
| </span> | ||
| <span hidden data-filter-value="@Model.TopicFilter"> | ||
| @Model.CourseTopic | ||
| </span> | ||
|
|
||
| <span class="nhsuk-u-margin-bottom-4"> | ||
| <span class="nhsuk-u-font-weight-bold">Created</span> @Model.CreatedDate.ToString(DateHelper.StandardDateFormat) | ||
| <span hidden data-name-for-sorting="created-date">@Model.CreatedDate</span> | ||
| </span> | ||
|
|
||
| <div> | ||
| <div class="header-row nhsuk-u-font-weight-bold"> | ||
| <div class="value header-row-content">Section</div> | ||
| <div class="value header-row-content">Tutorials</div> | ||
| </div> | ||
| <table> | ||
| <tr class="header-row nhsuk-u-font-weight-bold"> | ||
| <th class="value header-row-content">Section</th> | ||
|
Comment on lines
+40
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The NHS tables have specific roles for different table elements. Do we want them here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't believe we need them since we are using the correct html elements, looking at the various bits of documentation on them e.g. https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/row_role. |
||
| <th class="value header-row-content">Tutorials</th> | ||
| </tr> | ||
| @foreach (var section in Model.Sections) { | ||
| <div class="value-row"> | ||
| <div class="value"> | ||
| <tr class="value-row"> | ||
| <td class="value"> | ||
| <p class="responsive-header nhsuk-u-font-weight-bold nhsuk-u-margin-bottom-3">Section</p> | ||
| <p class="nhsuk-u-margin-bottom-3">@(section.SectionName)</p> | ||
| </div> | ||
| <div class="value"> | ||
| </td> | ||
| <td class="value"> | ||
| <p class="responsive-header nhsuk-u-font-weight-bold nhsuk-u-margin-bottom-3">Tutorials</p> | ||
| @if (section.Tutorials.Any()) { | ||
| @foreach (var tutorial in section.Tutorials) { | ||
|
|
@@ -53,10 +57,10 @@ | |
| } else { | ||
| <p class="nhsuk-u-margin-bottom-3">No tutorials</p> | ||
| } | ||
| </div> | ||
| </div> | ||
| </td> | ||
| </tr> | ||
| } | ||
| </div> | ||
| </table> | ||
| </div> | ||
| </details> | ||
| </div> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we fancy any unit tests for this?