Skip to content

Commit c6d3087

Browse files
committed
Add notification button to detailed guide template
1 parent c16a181 commit c6d3087

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

app/controllers/content_items_controller.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def render_template
135135
end
136136

137137
# use these and `@content_item.base_path` in the template
138-
@notification_button_visible = in_single_page_notifications_trial?
138+
@notification_button_visible = in_single_page_notifications_trial? && !@content_item.brexit_child_taxon
139139
@include_single_page_notification_button_js = account_session_header.present?
140140

141141
request.variant = :print if params[:variant] == "print"
@@ -216,6 +216,9 @@ def in_single_page_notifications_trial?
216216
%w[
217217
/government/publications/open-standards-for-government
218218
/government/publications/identity-proofing-and-verification-of-an-individual
219+
/guidance/travel-to-england-from-another-country-during-coronavirus-covid-19
220+
/guidance/covid-19-coronavirus-restrictions-what-you-can-and-cannot-do
221+
/government/publications/face-coverings-when-to-wear-one-and-how-to-make-your-own
219222
].include? @content_item.base_path
220223
end
221224
end

app/views/content_items/detailed_guide.html.erb

+10-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
</div>
3838

3939
<%= render 'shared/publisher_metadata_with_logo' unless brexit_child_taxon %>
40+
4041
<%= render 'shared/history_notice', content_item: @content_item %>
4142
<%= render 'govuk_publishing_components/components/notice', @content_item.withdrawal_notice_component %>
4243

@@ -65,8 +66,16 @@
6566
<%= render 'components/published-dates', {
6667
published: @content_item.published,
6768
last_updated: @content_item.updated,
68-
history: @content_item.history
69+
history: @content_item.history,
70+
margin_bottom: 3,
6971
} unless brexit_child_taxon %>
72+
73+
<%= render 'govuk_publishing_components/components/single_page_notification_button', {
74+
base_path: @content_item.base_path,
75+
js_enhancement: @include_single_page_notification_button_js,
76+
button_location: "bottom",
77+
margin_bottom: 0,
78+
} if @notification_button_visible %>
7079
</div>
7180
<% end %>
7281
<%= render "govuk_publishing_components/components/print_link", {

app/views/content_items/publication.html.erb

+1-6
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,7 @@
1818
</div>
1919

2020
<%= render 'shared/publisher_metadata_with_logo' %>
21-
<%= render 'govuk_publishing_components/components/single_page_notification_button', {
22-
base_path: @content_item.base_path,
23-
js_enhancement: @include_single_page_notification_button_js,
24-
margin_bottom: 6,
25-
button_location: "top",
26-
} if @notification_button_visible %>
21+
2722
<%= render 'shared/history_notice', content_item: @content_item %>
2823

2924
<%= render 'govuk_publishing_components/components/notice', @content_item.withdrawal_notice_component %>

app/views/shared/_publisher_metadata_with_logo.html.erb

+7
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,10 @@
1616
</div>
1717
</div>
1818
</div>
19+
20+
<%= render 'govuk_publishing_components/components/single_page_notification_button', {
21+
base_path: @content_item.base_path,
22+
js_enhancement: @include_single_page_notification_button_js,
23+
margin_bottom: 6,
24+
button_location: "top",
25+
} if @notification_button_visible %>

0 commit comments

Comments
 (0)