Skip to content

Commit

Permalink
ER-1187 Aria landmark update (#804)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
martikat authored Jun 21, 2024
1 parent 58d41d4 commit 31c2a35
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 40 deletions.
7 changes: 6 additions & 1 deletion app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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%;
}

Expand Down
8 changes: 5 additions & 3 deletions app/views/home/index.html.slim
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -17,6 +20,5 @@

= render 'pages/cards'

= render 'shared/ctas'

= render 'shared/other_resources'
.dfe-width-container
= render 'shared/ctas'
6 changes: 2 additions & 4 deletions app/views/layouts/application.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -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'
18 changes: 9 additions & 9 deletions app/views/layouts/hero.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -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'
8 changes: 5 additions & 3 deletions app/views/pages/default.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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'
11 changes: 6 additions & 5 deletions app/views/pages/index.html.slim
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -15,7 +20,3 @@

- if page.slug == 'cookie-policy'
= render 'settings/cookie_policy'

= render 'shared/ctas'

= render 'shared/other_resources'
8 changes: 5 additions & 3 deletions app/views/pages/side_nav.slim
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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'
23 changes: 11 additions & 12 deletions app/views/shared/_other_resources.html.slim
Original file line number Diff line number Diff line change
@@ -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
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

0 comments on commit 31c2a35

Please sign in to comment.