diff --git a/app/controllers/content_items_controller.rb b/app/controllers/content_items_controller.rb index 3dcbd998d..e09d428d1 100644 --- a/app/controllers/content_items_controller.rb +++ b/app/controllers/content_items_controller.rb @@ -87,7 +87,6 @@ def set_guide_draft_access_token def load_content_item content_item = Services.content_store.content_item(content_item_path) - if Services.feature_toggler.use_recommended_related_links?(content_item["links"], request.headers) content_item["links"]["ordered_related_items"] = content_item["links"].fetch("suggested_ordered_related_items", []) end diff --git a/app/presenters/content_item/brexit_hub_page.rb b/app/presenters/content_item/brexit_hub_page.rb new file mode 100644 index 000000000..e52737b3b --- /dev/null +++ b/app/presenters/content_item/brexit_hub_page.rb @@ -0,0 +1,26 @@ +module ContentItem + module BrexitHubPage + BREXIT_BUSINESS_PAGE_CONTENT_ID = "91cd6143-69d5-4f27-99ff-a52fb0d51c78".freeze + BREXIT_CITIZEN_PAGE_CONTENT_ID = "6555e0bf-c270-4cf9-a0c5-d20b95fab7f1".freeze + BREXIT_HUB_PAGE_CONTENT_IDS = [BREXIT_BUSINESS_PAGE_CONTENT_ID, BREXIT_CITIZEN_PAGE_CONTENT_ID].freeze + BREXIT_BUSINESS_PAGE_PATH = "/guidance/brexit-guidance-for-businesses".freeze + BREXIT_CITIZEN_PAGE_PATH = "/guidance/brexit-guidance-for-individuals-and-families".freeze + + def brexit_links + { + ContentItem::BrexitHubPage::BREXIT_BUSINESS_PAGE_CONTENT_ID => { + text: I18n.t("brexit.citizen_link"), + path: BREXIT_CITIZEN_PAGE_PATH, + }, + ContentItem::BrexitHubPage::BREXIT_CITIZEN_PAGE_CONTENT_ID => { + text: I18n.t("brexit.business_link"), + path: BREXIT_BUSINESS_PAGE_PATH, + }, + } + end + + def brexit_link + brexit_links[content_item.dig("content_id")] + end + end +end diff --git a/app/presenters/content_item_presenter.rb b/app/presenters/content_item_presenter.rb index 8919f445f..f160748d0 100644 --- a/app/presenters/content_item_presenter.rb +++ b/app/presenters/content_item_presenter.rb @@ -1,5 +1,6 @@ class ContentItemPresenter include ContentItem::Withdrawable + include ContentItem::BrexitHubPage attr_reader :content_item, :requested_path, diff --git a/app/views/content_items/detailed_guide.html.erb b/app/views/content_items/detailed_guide.html.erb index 4520e58b9..25484c57d 100644 --- a/app/views/content_items/detailed_guide.html.erb +++ b/app/views/content_items/detailed_guide.html.erb @@ -6,15 +6,24 @@
+ <%= I18n.t("brexit.heading_prefix") %> <%= link_to @content_item.brexit_link[:text], @content_item.brexit_link[:path] %>. +
+