From 31c2a35526b1ebaa5ab81856739546e2a79f5456 Mon Sep 17 00:00:00 2001 From: Katherine Martin <78093815+martikat@users.noreply.github.com> Date: Fri, 21 Jun 2024 14:10:02 +0100 Subject: [PATCH] ER-1187 Aria landmark update (#804) * Aria landmark update * Update where aria landmark updates are for the different pages * Update to remove deprecated feature * Update to fix where aside is for different pages * Update to fix skip link logic * Update based on PR comments * Update where aside is set and where yield is for views --- app/assets/stylesheets/application.scss | 7 ++++++- app/views/home/index.html.slim | 8 ++++--- app/views/layouts/application.html.slim | 6 ++---- app/views/layouts/hero.html.slim | 18 ++++++++-------- app/views/pages/default.html.slim | 8 ++++--- app/views/pages/index.html.slim | 11 +++++----- app/views/pages/side_nav.slim | 8 ++++--- app/views/shared/_other_resources.html.slim | 23 ++++++++++----------- 8 files changed, 49 insertions(+), 40 deletions(-) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 96e75bf7..4f4eaed8 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -61,7 +61,12 @@ $light-blue-link: darken($govuk-link-colour, 11%); } } -main img { +main img, +aside img { + max-width: 100%; +} + +.full-width-image { max-width: 100%; } diff --git a/app/views/home/index.html.slim b/app/views/home/index.html.slim index 04459ecf..03255ff8 100644 --- a/app/views/home/index.html.slim +++ b/app/views/home/index.html.slim @@ -1,6 +1,9 @@ - content_for(:page_title) do = page.title +- content_for(:aside) do + = render partial: 'shared/other_resources' + - content_for :hero do .govuk-grid-row class='govuk-!-margin-top-9' .govuk-grid-column-three-quarters @@ -17,6 +20,5 @@ = render 'pages/cards' -= render 'shared/ctas' - -= render 'shared/other_resources' +.dfe-width-container + = render 'shared/ctas' diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim index 587cecca..10717154 100644 --- a/app/views/layouts/application.html.slim +++ b/app/views/layouts/application.html.slim @@ -33,16 +33,14 @@ html.govuk-template lang='en' = render 'layouts/analytics_body' = render 'layouts/cookie_banner' - = govuk_skip_link + = govuk_skip_link(href: '#main-content') = navigation .dfe-width-container = render 'layouts/banner' - main#main-content.govuk-main-wrapper role='main' + .dfe-width-container class='govuk-!-padding-top-7 govuk-!-padding-bottom-7' = yield - = yield :other_resources - = render 'layouts/footer' diff --git a/app/views/layouts/hero.html.slim b/app/views/layouts/hero.html.slim index ca53125b..434df8cc 100644 --- a/app/views/layouts/hero.html.slim +++ b/app/views/layouts/hero.html.slim @@ -33,19 +33,19 @@ html.govuk-template lang='en' = render 'layouts/analytics_body' = render 'layouts/cookie_banner' - = govuk_skip_link + = govuk_skip_link(href: '#main-content') = navigation - .dfe-content-page--header class='govuk-!-padding-bottom-7' - .dfe-width-container - = render 'layouts/banner' - = yield :hero + main#main-content role='main' + .dfe-content-page--header class='govuk-!-padding-bottom-7' + .dfe-width-container + = render 'layouts/banner' + = yield :hero - .dfe-width-container - main#main-content.govuk-main-wrapper role='main' + .dfe-width-container class='govuk-!-padding-top-7 govuk-!-padding-bottom-7' = yield - - = yield :other_resources + aside role='complementary' + = yield :aside = render 'layouts/footer' diff --git a/app/views/pages/default.html.slim b/app/views/pages/default.html.slim index 76a5f4ce..a3bcf0c6 100644 --- a/app/views/pages/default.html.slim +++ b/app/views/pages/default.html.slim @@ -4,6 +4,11 @@ - content_for(:hero) do = render partial: 'hero', locals: { title: page.hero_title, description: page.hero_description } +- content_for(:aside) do + .dfe-width-container + = render partial: 'shared/ctas' + = render partial: 'shared/content_footer' + - if page.introduction.present? = m(page.introduction) @@ -26,6 +31,3 @@ .govuk-grid-column-full hr.govuk-section-break.govuk-section-break--xl.govuk-section-break--visible - -= render 'shared/ctas' -= render 'shared/content_footer' diff --git a/app/views/pages/index.html.slim b/app/views/pages/index.html.slim index dba2fcce..24737dad 100644 --- a/app/views/pages/index.html.slim +++ b/app/views/pages/index.html.slim @@ -1,9 +1,14 @@ - content_for(:page_title) do = page.title -- content_for(:hero) do +- content_for(:hero) do = render partial: 'hero', locals: { title: page.hero_title, description: page.hero_description } +- content_for(:aside) do + .dfe-width-container + = render partial: 'shared/ctas' + = render partial: 'shared/other_resources' + = render 'debug' = render 'layouts/flash' @@ -15,7 +20,3 @@ - if page.slug == 'cookie-policy' = render 'settings/cookie_policy' - -= render 'shared/ctas' - -= render 'shared/other_resources' diff --git a/app/views/pages/side_nav.slim b/app/views/pages/side_nav.slim index 76a86af7..08e01008 100644 --- a/app/views/pages/side_nav.slim +++ b/app/views/pages/side_nav.slim @@ -4,6 +4,11 @@ - content_for(:hero) do = render partial: 'hero', locals: { title: page.hero_title, description: page.hero_description } +- content_for(:aside) do + .dfe-width-container + = render partial: 'shared/ctas' + = render partial: 'shared/content_footer' + .govuk-grid-row .govuk-grid-column-one-quarter.sticky.mob-section input#menu-icon-chk.menu-btn[type="checkbox" name="menu-icon" checked] @@ -39,6 +44,3 @@ .govuk-grid-column-full hr.govuk-section-break.govuk-section-break--xl.govuk-section-break--visible - -= render 'shared/ctas' -= render 'shared/content_footer' diff --git a/app/views/shared/_other_resources.html.slim b/app/views/shared/_other_resources.html.slim index 930b2bd3..c3694aa1 100644 --- a/app/views/shared/_other_resources.html.slim +++ b/app/views/shared/_other_resources.html.slim @@ -1,12 +1,11 @@ -- content_for(:other_resources) do - section.hf-other.dfe-content-page--header - .govuk-width-container - .govuk-grid-row - .govuk-grid-column-three-quarters - ul.chevron-card-list - li.chevron-card - h2.govuk-heading-l - = other_useful_resources.title - p.govuk-body-l - = other_useful_resources.body - = render partial: 'shared/resource', collection: other_useful_resources.resources, as: :resource \ No newline at end of file +section.hf-other.dfe-content-page--header + .govuk-width-container + .govuk-grid-row + .govuk-grid-column-three-quarters + ul.chevron-card-list + li.chevron-card + h2.govuk-heading-l + = other_useful_resources.title + p.govuk-body-l + = other_useful_resources.body + = render partial: 'shared/resource', collection: other_useful_resources.resources, as: :resource