From f5400e95963f3ed65bf580a8e041b6aa644198f9 Mon Sep 17 00:00:00 2001 From: davidtrussler Date: Fri, 5 Apr 2024 12:39:54 +0100 Subject: [PATCH 01/12] Change heading level on updates to 1 --- app/views/content_items/manual_updates.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/content_items/manual_updates.html.erb b/app/views/content_items/manual_updates.html.erb index fe5820e93..52c216f97 100644 --- a/app/views/content_items/manual_updates.html.erb +++ b/app/views/content_items/manual_updates.html.erb @@ -1,7 +1,7 @@ <% add_view_stylesheet("manual") %> <% content_for :header do %> <%= render "content_items/manuals/header", { - content_item: @content_item, heading_level: 2, margin_bottom: 6, + content_item: @content_item, heading_level: 1, margin_bottom: 6, } %> <% end %> From b4d3d12ffa747e28e384f86a29af6ae949e2bbcf Mon Sep 17 00:00:00 2001 From: davidtrussler Date: Fri, 5 Apr 2024 12:58:04 +0100 Subject: [PATCH 02/12] Change font size for accordion heading to default (27px) --- app/views/content_items/manuals/_updates.html.erb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/views/content_items/manuals/_updates.html.erb b/app/views/content_items/manuals/_updates.html.erb index e9fefefe2..14cd27abf 100644 --- a/app/views/content_items/manuals/_updates.html.erb +++ b/app/views/content_items/manuals/_updates.html.erb @@ -14,8 +14,7 @@ <% content_item.presented_change_notes.each do |year, updates_by_year| %>
<%= render "govuk_publishing_components/components/heading", { - text: year, - font_size: "l" + text: year } %> <%= render "govuk_publishing_components/components/accordion", { From 8a29c1538acff203165824ce6d87bda465bdffe8 Mon Sep 17 00:00:00 2001 From: davidtrussler Date: Mon, 8 Apr 2024 10:29:34 +0100 Subject: [PATCH 03/12] Change heading level for hmrc manual updates to 1 --- app/views/content_items/hmrc_manual_updates.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/content_items/hmrc_manual_updates.html.erb b/app/views/content_items/hmrc_manual_updates.html.erb index c77ffacdd..583f4cc00 100644 --- a/app/views/content_items/hmrc_manual_updates.html.erb +++ b/app/views/content_items/hmrc_manual_updates.html.erb @@ -2,7 +2,7 @@ <% content_for :header do %> <%= render "content_items/manuals/header", { content_item: @content_item, - heading_level: 2, + heading_level: 1, margin_bottom: 6, green_background: true, type: I18n.t("manuals.hmrc_manual_type"), From ba624cf7007c1ec46a5e316a877f19722670ec09 Mon Sep 17 00:00:00 2001 From: davidtrussler Date: Mon, 8 Apr 2024 12:06:14 +0100 Subject: [PATCH 04/12] Change font size for h2 to default (27px) --- app/views/content_items/manual_section.html.erb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/views/content_items/manual_section.html.erb b/app/views/content_items/manual_section.html.erb index e949a444f..847c154e8 100644 --- a/app/views/content_items/manual_section.html.erb +++ b/app/views/content_items/manual_section.html.erb @@ -20,7 +20,6 @@
<%= render "govuk_publishing_components/components/heading", { text: item[:heading][:text], - font_size: "m", margin_bottom: 1, id: item[:heading][:id], } %> From a723fcfe0ab4114cea612d7e76fe008191662b95 Mon Sep 17 00:00:00 2001 From: davidtrussler Date: Fri, 12 Apr 2024 12:18:01 +0100 Subject: [PATCH 05/12] Updates | content design: Changes page title to h2 and reduces size --- app/views/content_items/manual_updates.html.erb | 4 +++- app/views/content_items/manuals/_header.html.erb | 1 - test/integration/manual_section_test.rb | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/content_items/manual_updates.html.erb b/app/views/content_items/manual_updates.html.erb index 52c216f97..2f18c3161 100644 --- a/app/views/content_items/manual_updates.html.erb +++ b/app/views/content_items/manual_updates.html.erb @@ -1,7 +1,9 @@ <% add_view_stylesheet("manual") %> <% content_for :header do %> <%= render "content_items/manuals/header", { - content_item: @content_item, heading_level: 1, margin_bottom: 6, + content_item: @content_item, + heading_level: 2, + margin_bottom: 6 } %> <% end %> diff --git a/app/views/content_items/manuals/_header.html.erb b/app/views/content_items/manuals/_header.html.erb index 131afc3c2..f67d5c896 100644 --- a/app/views/content_items/manuals/_header.html.erb +++ b/app/views/content_items/manuals/_header.html.erb @@ -15,7 +15,6 @@ <%= render "govuk_publishing_components/components/heading", { text: content_item.title, - font_size: "l", inverse: true, id: "manual-title", heading_level: heading_level, diff --git a/test/integration/manual_section_test.rb b/test/integration/manual_section_test.rb index 776159856..1591207c5 100644 --- a/test/integration/manual_section_test.rb +++ b/test/integration/manual_section_test.rb @@ -50,7 +50,7 @@ class ManualSectionTest < ActionDispatch::IntegrationTest test "renders document heading" do setup_and_visit_manual_section - within "#manual-title.govuk-heading-l" do + within "#manual-title" do assert page.has_text?(@manual["title"]) end end From ccf86739733a245150c5cd7ae9e65a90953ebdf4 Mon Sep 17 00:00:00 2001 From: davidtrussler Date: Fri, 12 Apr 2024 12:21:41 +0100 Subject: [PATCH 06/12] Updates | hmrc: Changes page title to h2 and reduces size --- app/views/content_items/hmrc_manual_updates.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/content_items/hmrc_manual_updates.html.erb b/app/views/content_items/hmrc_manual_updates.html.erb index 583f4cc00..c77ffacdd 100644 --- a/app/views/content_items/hmrc_manual_updates.html.erb +++ b/app/views/content_items/hmrc_manual_updates.html.erb @@ -2,7 +2,7 @@ <% content_for :header do %> <%= render "content_items/manuals/header", { content_item: @content_item, - heading_level: 1, + heading_level: 2, margin_bottom: 6, green_background: true, type: I18n.t("manuals.hmrc_manual_type"), From 3273d3c2f9ff177c07b50192ae57a8190994abe3 Mon Sep 17 00:00:00 2001 From: davidtrussler Date: Fri, 12 Apr 2024 12:33:36 +0100 Subject: [PATCH 07/12] Manuals: Changes page title to h2 and reduces size --- app/views/content_items/manual_section.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/content_items/manual_section.html.erb b/app/views/content_items/manual_section.html.erb index 847c154e8..6630e8401 100644 --- a/app/views/content_items/manual_section.html.erb +++ b/app/views/content_items/manual_section.html.erb @@ -1,7 +1,9 @@ <% add_view_stylesheet("manual") %> <% content_for :header do %> <%= render "content_items/manuals/header", { - content_item: @content_item, heading_level: 1, margin_bottom: 6, + content_item: @content_item, + heading_level: 2, + margin_bottom: 6 } %> <%= render partial: "content_items/manuals/breadcrumbs" %> <% end %> From 6d28777dff3148c72efad38f99c4ddb3d97d2b56 Mon Sep 17 00:00:00 2001 From: davidtrussler Date: Fri, 12 Apr 2024 12:36:25 +0100 Subject: [PATCH 08/12] Updates | content design: Update h1 to replicate page title --- config/locales/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index c36938c3c..66bf93528 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -483,7 +483,7 @@ en: updates_amendments: published amendments updates_description: List of updates to '%{title}'. updates_page_title: Updates - %{title} - updates_title: 'Updates: %{title}' + updates_title: 'Updates - %{title}' multi_page: next_page: Next previous_page: Previous From f2258bfe0da06a660a209ff1181fb310f4cd203e Mon Sep 17 00:00:00 2001 From: davidtrussler Date: Fri, 12 Apr 2024 13:05:20 +0100 Subject: [PATCH 09/12] Updates | hmrc: Update h1 to replicate page title --- app/views/content_items/hmrc_manual_updates.html.erb | 2 +- .../manuals/_manual_updates_layout.html.erb | 6 +++++- app/views/content_items/manuals/_updates.html.erb | 12 +++++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/views/content_items/hmrc_manual_updates.html.erb b/app/views/content_items/hmrc_manual_updates.html.erb index c77ffacdd..8fdf53361 100644 --- a/app/views/content_items/hmrc_manual_updates.html.erb +++ b/app/views/content_items/hmrc_manual_updates.html.erb @@ -9,4 +9,4 @@ } %> <% end %> -<%= render "content_items/manuals/manual_updates_layout" %> \ No newline at end of file +<%= render "content_items/manuals/manual_updates_layout", type: I18n.t("manuals.hmrc_manual_type") %> diff --git a/app/views/content_items/manuals/_manual_updates_layout.html.erb b/app/views/content_items/manuals/_manual_updates_layout.html.erb index 1ee818928..4c7a6fdb3 100644 --- a/app/views/content_items/manuals/_manual_updates_layout.html.erb +++ b/app/views/content_items/manuals/_manual_updates_layout.html.erb @@ -1,9 +1,13 @@ +<% + type ||= nil +%> + <% content_for :main do %> <%= render "govuk_publishing_components/components/back_link", { text: t("manuals.breadcrumb_contents"), href: @content_item.base_path } %>
- <%= render "content_items/manuals/updates", content_item: @content_item %> + <%= render "content_items/manuals/updates", content_item: @content_item, manual_type: type %>
<% end %> diff --git a/app/views/content_items/manuals/_updates.html.erb b/app/views/content_items/manuals/_updates.html.erb index 14cd27abf..967166f82 100644 --- a/app/views/content_items/manuals/_updates.html.erb +++ b/app/views/content_items/manuals/_updates.html.erb @@ -1,3 +1,13 @@ +<% + manual_type ||= nil + + if manual_type + text = "#{t("manuals.updates_title", title: content_item.title)} - #{manual_type}" + else + text = t("manuals.updates_title", title: content_item.title) + end +%> +
@@ -7,7 +17,7 @@ heading_level: 1, id: "section-title", margin_bottom: 4, - text: t("manuals.updates_title", title: content_item.title), + text: text } %>
From 05118063778213f5387e4d3151df4c4b22d4f5aa Mon Sep 17 00:00:00 2001 From: davidtrussler Date: Fri, 12 Apr 2024 14:32:03 +0100 Subject: [PATCH 10/12] Manuals: Update h1 to replicate page title --- app/views/content_items/manuals/_manual_section_layout.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/content_items/manuals/_manual_section_layout.html.erb b/app/views/content_items/manuals/_manual_section_layout.html.erb index c152f9d71..cc68cf180 100644 --- a/app/views/content_items/manuals/_manual_section_layout.html.erb +++ b/app/views/content_items/manuals/_manual_section_layout.html.erb @@ -13,7 +13,7 @@
<%= render "govuk_publishing_components/components/heading", { - text: @content_item.document_heading.join(" - "), + text: "#{@content_item.title} - #{@content_item.document_heading.join(" - ")}", font_size: "l", id: "section-title", heading_level: 1, From 054b5bd148712c5e99d85a4c8cae4fcef02659cf Mon Sep 17 00:00:00 2001 From: Hanna Laakso Date: Mon, 7 Oct 2024 15:34:28 +0100 Subject: [PATCH 11/12] tidyup plus bump to get review app up --- app/views/content_items/manual_updates.html.erb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/views/content_items/manual_updates.html.erb b/app/views/content_items/manual_updates.html.erb index 2f18c3161..19644f0d0 100644 --- a/app/views/content_items/manual_updates.html.erb +++ b/app/views/content_items/manual_updates.html.erb @@ -1,9 +1,7 @@ <% add_view_stylesheet("manual") %> <% content_for :header do %> <%= render "content_items/manuals/header", { - content_item: @content_item, - heading_level: 2, - margin_bottom: 6 + content_item: @content_item, heading_level: 2, margin_bottom: 6 } %> <% end %> From a6506ccb120d3a85528fe8ed4254e33529117e28 Mon Sep 17 00:00:00 2001 From: Hanna Laakso Date: Mon, 7 Oct 2024 17:00:26 +0100 Subject: [PATCH 12/12] wip design debug: test accordion heading size change --- app/assets/stylesheets/views/_manual.scss | 4 + .../content_items/manuals/_updates.html.erb | 76 ++++++++++--------- 2 files changed, 44 insertions(+), 36 deletions(-) diff --git a/app/assets/stylesheets/views/_manual.scss b/app/assets/stylesheets/views/_manual.scss index 73a08c5f4..776a33abd 100644 --- a/app/assets/stylesheets/views/_manual.scss +++ b/app/assets/stylesheets/views/_manual.scss @@ -142,3 +142,7 @@ padding-right: govuk-spacing(3); } } + +.test-accordion-heading-s .govuk-accordion__section-heading-text { + font-size: 16px; +} diff --git a/app/views/content_items/manuals/_updates.html.erb b/app/views/content_items/manuals/_updates.html.erb index 967166f82..008a84ccf 100644 --- a/app/views/content_items/manuals/_updates.html.erb +++ b/app/views/content_items/manuals/_updates.html.erb @@ -27,45 +27,49 @@ text: year } %> - <%= render "govuk_publishing_components/components/accordion", { - heading_level: 3, - items: updates_by_year.each.with_index(1).map do |updated_documents, index| - accordion_content = capture do %> - <% change_notes = updated_documents.last %> -
- <% change_notes.each do |change_note_entry| %> - <% change_note_items = change_note_entry.last.collect { |i| i["change_note"] } %> - <% change_note = change_note_entry.flatten.last %> - <% if change_note["title"].present? %> -

- <%= link_to change_note["title"], change_note["base_path"], class: "govuk-link" %> -

+
+ <%= render "govuk_publishing_components/components/accordion", { + heading_level: 3, + items: updates_by_year.each.with_index(1).map do |updated_documents, index| + accordion_content = capture do %> + <% change_notes = updated_documents.last %> +
+ <% change_notes.each do |change_note_entry| %> + <% change_note_items = change_note_entry.last.collect { |i| i["change_note"] } %> + <% change_note = change_note_entry.flatten.last %> + <% if change_note["title"].present? %> +

+ <%= link_to change_note["title"], change_note["base_path"], class: "govuk-link" %> +

+ <% end %> + <% change_note_items.each do |change_note_item| %> + <%= simple_format(change_note_item, class: "govuk-body") %> + <% end %> <% end %> - <% change_note_items.each do |change_note_item| %> - <%= simple_format(change_note_item, class: "govuk-body") %> - <% end %> - <% end %> -
- <% end - { - data_attributes: { - ga4_event: { - event_name: 'select_content', - type: 'accordion', - text: sanitize_manual_update_title(updated_documents.first), - index: index, - index_total: updates_by_year.length, +
+ <% end + { + data_attributes: { + ga4_event: { + event_name: 'select_content', + type: 'accordion', + text: sanitize_manual_update_title(updated_documents.first), + index: index, + index_total: updates_by_year.length, + } + }, + heading: { + text: updated_documents.first, + }, + content: { + html: accordion_content } - }, - heading: { - text: updated_documents.first, - }, - content: { - html: accordion_content } - } - end - } %> + end + } %> +
+ +
<% end %>