- ">
- <% @content_item.header_links.each do |header_link| %>
-
- - <%= link_to(header_link[:title], header_link[:href], class: 'govuk-link') %> - - <% end %> -
From 7be2f35fff06e7b0a64488f5f0f7770448f39aee Mon Sep 17 00:00:00 2001 From: Rebecca Pearce <17481621+beccapearce@users.noreply.github.com> Date: Tue, 12 Mar 2024 13:52:39 +0000 Subject: [PATCH 1/3] Use publishing component to render contents list on service manual guide When the contents list on service manual guides was being read out by screen readers it would read the dashes in the contents list as "en dash" This was not desired behaviour and has been fixed in the govuk-publishing-components. This uses the fixed publishing component to take advantage of the fixed behaviour. Using the new publishing component also makes the page more consistent with other pages within the app. --- .../service_manual_guide_presenter.rb | 2 +- .../service_manual_guide.html.erb | 31 +++---------------- .../service_manual_guide_presenter_test.rb | 4 +++ 3 files changed, 10 insertions(+), 27 deletions(-) diff --git a/app/presenters/service_manual_guide_presenter.rb b/app/presenters/service_manual_guide_presenter.rb index 5f0c3d3a0..deade88aa 100644 --- a/app/presenters/service_manual_guide_presenter.rb +++ b/app/presenters/service_manual_guide_presenter.rb @@ -8,7 +8,7 @@ def body def header_links header_links = details.fetch("header_links", {}) - Array(header_links).map { |h| ActiveSupport::HashWithIndifferentAccess.new(h) } + Array(header_links).map { |h| ActiveSupport::HashWithIndifferentAccess.new(h.transform_keys { |k| k == "title" ? "text" : k }) } end def content_owners diff --git a/app/views/content_items/service_manual_guide.html.erb b/app/views/content_items/service_manual_guide.html.erb index fadba9aaf..a2b05696c 100644 --- a/app/views/content_items/service_manual_guide.html.erb +++ b/app/views/content_items/service_manual_guide.html.erb @@ -54,32 +54,11 @@