diff --git a/app/views/content_items/consultation.html.erb b/app/views/content_items/consultation.html.erb index f92143163..5264cd9eb 100644 --- a/app/views/content_items/consultation.html.erb +++ b/app/views/content_items/consultation.html.erb @@ -196,11 +196,7 @@ %> - <%= render 'components/published-dates', { - published: @content_item.published, - last_updated: @content_item.updated, - history: @content_item.history - } %> + <%= render 'shared/published_dates_with_notification_button' %> <%= render 'shared/sidebar_navigation' %> diff --git a/app/views/content_items/detailed_guide.html.erb b/app/views/content_items/detailed_guide.html.erb index dc7f34180..be495fead 100644 --- a/app/views/content_items/detailed_guide.html.erb +++ b/app/views/content_items/detailed_guide.html.erb @@ -115,19 +115,7 @@ <% end %>
- <%= render 'components/published-dates', { - published: @content_item.published, - last_updated: @content_item.updated, - history: @content_item.history, - margin_bottom: 3, - } unless brexit_child_taxon %> - - <%= render 'govuk_publishing_components/components/single_page_notification_button', { - base_path: @content_item.base_path, - js_enhancement: @include_single_page_notification_button_js, - button_location: "bottom", - margin_bottom: 0, - } if @notification_button_visible %> + <%= render 'shared/published_dates_with_notification_button', { brexit_child_taxon: brexit_child_taxon } %>
<% end %> <%= render "govuk_publishing_components/components/print_link", { diff --git a/app/views/content_items/publication.html.erb b/app/views/content_items/publication.html.erb index 689e21a28..7c36ca386 100644 --- a/app/views/content_items/publication.html.erb +++ b/app/views/content_items/publication.html.erb @@ -54,19 +54,7 @@ <% end %> - - <%= render 'components/published-dates', { - published: @content_item.published, - last_updated: @content_item.updated, - history: @content_item.history, - margin_bottom: 3 - } %> - - <%= render 'govuk_publishing_components/components/single_page_notification_button', { - base_path: @content_item.base_path, - js_enhancement: @include_single_page_notification_button_js, - button_location: "bottom", - } if @notification_button_visible %> + <%= render 'shared/published_dates_with_notification_button' %> <%= render 'shared/sidebar_navigation' %> diff --git a/app/views/shared/_published_dates_with_notification_button.html.erb b/app/views/shared/_published_dates_with_notification_button.html.erb new file mode 100644 index 000000000..44450ddcb --- /dev/null +++ b/app/views/shared/_published_dates_with_notification_button.html.erb @@ -0,0 +1,14 @@ +<% brexit_child_taxon ||= nil %> + +<%= render 'components/published-dates', { + published: @content_item.published, + last_updated: @content_item.updated, + history: @content_item.history, + margin_bottom: 3, + } unless brexit_child_taxon %> +<%= render 'govuk_publishing_components/components/single_page_notification_button', { + base_path: @content_item.base_path, + js_enhancement: @include_single_page_notification_button_js, + button_location: "bottom", + margin_bottom: 0, +} if @notification_button_visible %>