diff --git a/app/presenters/document_collection_presenter.rb b/app/presenters/document_collection_presenter.rb index 8440dd624..ac977202c 100644 --- a/app/presenters/document_collection_presenter.rb +++ b/app/presenters/document_collection_presenter.rb @@ -4,6 +4,7 @@ class DocumentCollectionPresenter < ContentItemPresenter include ContentItem::Political include ContentItem::TitleAndContext include ContentItem::ContentsList + include ContentItem::SinglePageNotificationButton def contents_items groups.map do |group| diff --git a/app/views/content_items/document_collection.html.erb b/app/views/content_items/document_collection.html.erb index 0a95dcebd..7f3e398e2 100644 --- a/app/views/content_items/document_collection.html.erb +++ b/app/views/content_items/document_collection.html.erb @@ -22,6 +22,7 @@ <%= render 'shared/publisher_metadata_with_logo' %> +<%= render 'shared/single_page_notification_button', content_item: @content_item, skip_account: "true" %>
diff --git a/app/views/shared/_published_dates_with_notification_button.html.erb b/app/views/shared/_published_dates_with_notification_button.html.erb index 515276104..94e7e8852 100644 --- a/app/views/shared/_published_dates_with_notification_button.html.erb +++ b/app/views/shared/_published_dates_with_notification_button.html.erb @@ -1,4 +1,5 @@ <% add_view_stylesheet("published-dates-button-group") %> +<% skip_account = skip_account || "false" %> <%= render 'components/published_dates', { published: @content_item.published, @@ -13,6 +14,7 @@ js_enhancement: @has_govuk_account, button_location: "bottom", margin_bottom: 3, + skip_account: skip_account, ga4_data_attributes: { module: "ga4-link-tracker", ga4_link: { @@ -24,7 +26,7 @@ index_total: 2, section: "Footer" } - } + } } if @content_item.has_single_page_notifications? %> <%= render "govuk_publishing_components/components/print_link", { margin_top: 0, diff --git a/app/views/shared/_single_page_notification_button.html.erb b/app/views/shared/_single_page_notification_button.html.erb index 4781454e4..add2a1ea5 100644 --- a/app/views/shared/_single_page_notification_button.html.erb +++ b/app/views/shared/_single_page_notification_button.html.erb @@ -14,6 +14,7 @@ %> <% ga4_data_attributes = ga4_data_attributes || default_ga4_data_attributes %> +<% skip_account = skip_account || "false" %> <%= render 'govuk_publishing_components/components/single_page_notification_button', { base_path: @content_item.base_path, @@ -21,4 +22,5 @@ ga4_data_attributes: ga4_data_attributes, margin_bottom: 6, button_location: "top", + skip_account: skip_account, } if @content_item.has_single_page_notifications? %> diff --git a/test/integration/document_collection_test.rb b/test/integration/document_collection_test.rb index be1ca4f6a..fdacbab3c 100644 --- a/test/integration/document_collection_test.rb +++ b/test/integration/document_collection_test.rb @@ -154,8 +154,8 @@ class DocumentCollectionTest < ActionDispatch::IntegrationTest end end - test "does not render with the single page notification button" do + test "renders with the single page notification button" do setup_and_visit_content_item("document_collection") - assert_not page.has_css?(".gem-c-single-page-notification-button") + assert page.has_css?(".gem-c-single-page-notification-button") end end