Skip to content

Commit

Permalink
Fix missing headings and replace subpage breadcrumb with back link
Browse files Browse the repository at this point in the history
* Replaced the landing-page breadcrumb with H2
* Replaced the sub-page breadcrumb with the back link component
* Added a "Contents" H2 above the document list
* Rewrote tests accordingly
  • Loading branch information
matthillco authored and CodeSonia committed Jun 13, 2024
1 parent 25a72ab commit 8128fb2
Show file tree
Hide file tree
Showing 77 changed files with 177 additions and 38 deletions.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/views/_manual.scss
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@

.manual-body {
@include govuk-media-query($from: tablet) {
margin-top: govuk-spacing(6);
margin-top: govuk-spacing(4);
}

.section-title {
Expand Down
6 changes: 1 addition & 5 deletions app/views/content_items/manuals/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
type ||= nil

classes = %w[govuk-grid-row manuals-header]
classes << %w[govuk-!-margin-bottom-4]
classes << "hmrc" if green_background
%>

Expand Down Expand Up @@ -47,8 +48,3 @@
</div>
</div>
<% end %>

<%= render "govuk_publishing_components/components/breadcrumbs", {
border: "bottom",
breadcrumbs: @content_item.breadcrumbs,
collapse_on_mobile: false } %>
11 changes: 10 additions & 1 deletion app/views/content_items/manuals/_manual_layout.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<% content_for :main do %>
<%= render "govuk_publishing_components/components/heading", {
text: t("manuals.summary_title"),
margin_bottom: 4
} %>
<div id="manuals-frontend" class="manuals-frontend-body">

<%= machine_readable_metadata(schema: :article) %>
Expand All @@ -15,8 +19,13 @@
<% end %>
<% end %>

<%= render "govuk_publishing_components/components/heading", {
text: t("manuals.contents_title"),
margin_bottom: 4
} %>

<%= yield %>

<%= render 'govuk_publishing_components/components/print_link' %>
</div>
<% end %>
<% end %>
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<% show_contents ||= false %>

<% content_for :main do %>
<%= render "govuk_publishing_components/components/back_link", {
text: t("manuals.breadcrumb_contents"),
href: @content_item.base_path
} %>
<div id="manuals-frontend" class="manuals-frontend-body">
<% if show_contents %>
<%= render "govuk_publishing_components/components/contents_list", {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<% content_for :main do %>
<%= render "govuk_publishing_components/components/back_link", {
text: t("manuals.breadcrumb_contents"),
href: @content_item.base_path
} %>
<div id="manuals-frontend" class="manuals-frontend-body">
<%= render "content_items/manuals/updates", content_item: @content_item %>
</div>
Expand Down
2 changes: 2 additions & 0 deletions config/locales/ar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -775,8 +775,10 @@ ar:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/az.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,10 @@ az:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/be.yml
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,10 @@ be:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/bg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,10 @@ bg:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/bn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,10 @@ bn:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,10 @@ cs:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/cy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -775,8 +775,10 @@ cy:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/da.yml
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,10 @@ da:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,10 @@ de:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/dr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,10 @@ dr:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,10 @@ el:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
4 changes: 3 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,10 @@ en:
zh-hk: Cantonese
zh-tw: Traditional Chinese
manuals:
breadcrumb_contents: Contents
summary_title: Summary
breadcrumb_contents: Back to contents
contents_list_breadcrumb_contents: Manual homepage
contents_title: Contents
hmrc_manual_type: HMRC internal manual
hmrc_title: "%{title}HMRC internal manual"
next_page: Next page
Expand Down
2 changes: 2 additions & 0 deletions config/locales/es-419.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,10 @@ es-419:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,10 @@ es:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/et.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,10 @@ et:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/fa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,10 @@ fa:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/fi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,10 @@ fi:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,10 @@ fr:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/gd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,10 @@ gd:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/gu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,10 @@ gu:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/he.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,10 @@ he:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/hi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,10 @@ hi:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/hr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,10 @@ hr:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/hu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,10 @@ hu:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/hy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,10 @@ hy:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/id.yml
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,10 @@ id:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/is.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,10 @@ is:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,10 @@ it:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
2 changes: 2 additions & 0 deletions config/locales/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,10 @@ ja:
zh-hk:
zh-tw:
manuals:
summary_title:
breadcrumb_contents:
contents_list_breadcrumb_contents:
contents_title:
hmrc_manual_type:
hmrc_title:
next_page:
Expand Down
Loading

0 comments on commit 8128fb2

Please sign in to comment.