Skip to content

Commit

Permalink
Support page notification button on consultation
Browse files Browse the repository at this point in the history
Add support for the single page notification buton to the consultation
template. The button will not appear until the feature is enabled on
pages with this content type.

Seeing as the button is always grouped together with the published dates
component I created a new  `published_dates_with_notification_button`
partial to be shared between publications, detailed_guides and
consultations.
  • Loading branch information
danacotoran committed Jan 31, 2022
1 parent 581f785 commit 85d7a02
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 31 deletions.
6 changes: 1 addition & 5 deletions app/views/content_items/consultation.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,7 @@
%>
</div>

<%= render 'components/published-dates', {
published: @content_item.published,
last_updated: @content_item.updated,
history: @content_item.history
} %>
<%= render 'shared/published_dates_with_notification_button' %>
</div>
</div>
<%= render 'shared/sidebar_navigation' %>
Expand Down
14 changes: 1 addition & 13 deletions app/views/content_items/detailed_guide.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,7 @@
<% end %>

<div class="responsive-bottom-margin">
<%= 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 } %>
</div>
<% end %>
<%= render "govuk_publishing_components/components/print_link", {
Expand Down
14 changes: 1 addition & 13 deletions app/views/content_items/publication.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,7 @@
<% end %>
</section>
</div>

<%= 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' %>
</div>
</div>
<%= render 'shared/sidebar_navigation' %>
Expand Down
Original file line number Diff line number Diff line change
@@ -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 %>

0 comments on commit 85d7a02

Please sign in to comment.