Skip to content

Commit 4c883d1

Browse files
danacotoranbarrucadu
authored andcommitted
Add the notification button to publication template
1 parent a5b2566 commit 4c883d1

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

app/assets/javascripts/application.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//= require govuk_publishing_components/components/govspeak
77
//= require govuk_publishing_components/components/print-link
88
//= require govuk_publishing_components/components/radio
9+
//= require govuk_publishing_components/components/single-page-notification-button
910
//= require govuk_publishing_components/components/step-by-step-nav
1011

1112
//= require_tree ./modules

app/assets/stylesheets/application.scss

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ $govuk-new-link-styles: true;
4242
@import 'govuk_publishing_components/components/radio';
4343
@import 'govuk_publishing_components/components/related-navigation';
4444
@import 'govuk_publishing_components/components/share-links';
45+
@import 'govuk_publishing_components/components/single-page-notification-button';
4546
@import 'govuk_publishing_components/components/step-by-step-nav';
4647
@import 'govuk_publishing_components/components/step-by-step-nav-header';
4748
@import 'govuk_publishing_components/components/step-by-step-nav-related';

app/views/content_items/publication.html.erb

+14-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
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 %>
2127
<%= render 'shared/history_notice', content_item: @content_item %>
2228

2329
<%= render 'govuk_publishing_components/components/notice', @content_item.withdrawal_notice_component %>
@@ -53,8 +59,15 @@
5359
<%= render 'components/published-dates', {
5460
published: @content_item.published,
5561
last_updated: @content_item.updated,
56-
history: @content_item.history
62+
history: @content_item.history,
63+
margin_bottom: 3
5764
} %>
65+
66+
<%= render 'govuk_publishing_components/components/single_page_notification_button', {
67+
base_path: @content_item.base_path,
68+
js_enhancement: @include_single_page_notification_button_js,
69+
button_location: "bottom",
70+
} if @notification_button_visible %>
5871
</div>
5972
</div>
6073
<%= render 'shared/sidebar_navigation' %>

app/views/shared/_publisher_metadata_with_logo.html.erb

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
<%
2+
metadata_component_options = @content_item.publisher_metadata
3+
metadata_component_options[:margin_bottom] = 3 if @notification_button_visible
4+
%>
15
<div class="govuk-grid-row">
26
<div class="metadata-logo-wrapper<%= ' responsive-bottom-margin' if @content_item.try(:logo) %>">
37
<div class="govuk-grid-column-two-thirds metadata-column">
4-
<%= render 'govuk_publishing_components/components/metadata', @content_item.publisher_metadata %>
8+
<%= render 'govuk_publishing_components/components/metadata', metadata_component_options %>
59
</div>
610
<div class="govuk-grid-column-one-third">
711
<% if @content_item.try(:logo) %>

0 commit comments

Comments
 (0)