diff --git a/app/controllers/worldwide_corporate_information_page_controller.rb b/app/controllers/worldwide_corporate_information_page_controller.rb index 7cb277222f..45f79f736d 100644 --- a/app/controllers/worldwide_corporate_information_page_controller.rb +++ b/app/controllers/worldwide_corporate_information_page_controller.rb @@ -2,6 +2,7 @@ class WorldwideCorporateInformationPageController < ContentItemsController include Cacheable def show - @presenter = WorldwideCorporateInformationPagePresenter.new(content_item) + @content_item_presenter = WorldwideCorporateInformationPagePresenter.new(content_item) + render layout: "header_content_sidebar" end end diff --git a/app/presenters/worldwide_corporate_information_page_presenter.rb b/app/presenters/worldwide_corporate_information_page_presenter.rb index ac888270f5..ef4e708ef9 100644 --- a/app/presenters/worldwide_corporate_information_page_presenter.rb +++ b/app/presenters/worldwide_corporate_information_page_presenter.rb @@ -2,6 +2,16 @@ class WorldwideCorporateInformationPagePresenter < ContentItemPresenter include WorldwideOrganisationBranding include ContentsList + def page_title_options + super.merge({ + organisation_logo: worldwide_organisation.organisation_logo, + organisation_logo_heading_level: 1, + heading_level: 2, + world_location_links: worldwide_organisation.world_location_links, + sponsoring_organisation_links: worldwide_organisation.sponsoring_organisation_links, + }) + end + def worldwide_organisation return unless content_item.worldwide_organisation diff --git a/app/views/worldwide_corporate_information_page/show.html.erb b/app/views/worldwide_corporate_information_page/show.html.erb index c6235f38cf..d26494b130 100644 --- a/app/views/worldwide_corporate_information_page/show.html.erb +++ b/app/views/worldwide_corporate_information_page/show.html.erb @@ -1,27 +1,14 @@ -<%= render partial: "worldwide_organisation/header", locals: { - worldwide_organisation: @presenter.worldwide_organisation, - show_header_title: false, -} %> +<% content_for :header do %> + <%= render "shared/headers/page_title", options: @content_item_presenter.page_title_options %> +<% end %> -
-
+<% content_for :content do %> <%= render "govuk_publishing_components/components/contents_list", - contents: @presenter.headers_for_contents_list_component, - underline_links: true %> -
- -
- <%= render "govuk_publishing_components/components/heading", { - text: @content_item.title, - heading_level: 2, - font_size: "xl", - margin_bottom: 4, - } %> - -

<%= @content_item.description %>

- + contents: @content_item_presenter.headers_for_contents_list_component, + underline_links: true %> +
<%= render "govuk_publishing_components/components/govspeak", {} do - raw(@content_item.body) + raw(content_item.body) end %> -
-
+ +<% end %> diff --git a/spec/system/worldwide_corporate_information_page_spec.rb b/spec/system/worldwide_corporate_information_page_spec.rb index 45372812e8..49c0f9f1ff 100644 --- a/spec/system/worldwide_corporate_information_page_spec.rb +++ b/spec/system/worldwide_corporate_information_page_spec.rb @@ -34,14 +34,12 @@ end it "includes the world locations and sponsoring organisations" do - within find(".worldwide-organisation-header__metadata", match: :first) do - expect(page).to have_text("News:") - expect(page).to have_link("Philippines with translation and the UK", href: "/world/philippines/news") - expect(page).to have_link("Palau with translation and the UK", href: "/world/palau/news") + expect(page).to have_text("News:") + expect(page).to have_link("Philippines with translation and the UK", href: "/world/philippines/news") + expect(page).to have_link("Palau with translation and the UK", href: "/world/palau/news") - expect(page).to have_text("Part of:") - expect(page).to have_link("Foreign, Commonwealth & Development Office", href: "/government/organisations/foreign-commonwealth-development-office") - end + expect(page).to have_text("Part of:") + expect(page).to have_link("Foreign, Commonwealth & Development Office", href: "/government/organisations/foreign-commonwealth-development-office") end it "omits the world locations and sponsoring organisations when they are absent" do @@ -51,10 +49,8 @@ stub_content_store_has_item(base_path, content_store_response) visit base_path - within find(".worldwide-organisation-header__metadata", match: :first) do - expect(page).not_to have_text("Location:") - expect(page).not_to have_text("Part of:") - end + expect(page).not_to have_text("Location:") + expect(page).not_to have_text("Part of:") end it "does not render the translations when there are no translations" do