Skip to content

Commit

Permalink
Add the notification button to publication template
Browse files Browse the repository at this point in the history
  • Loading branch information
danacotoran authored and barrucadu committed Nov 23, 2021
1 parent a5b2566 commit 4c883d1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//= require govuk_publishing_components/components/govspeak
//= require govuk_publishing_components/components/print-link
//= require govuk_publishing_components/components/radio
//= require govuk_publishing_components/components/single-page-notification-button
//= require govuk_publishing_components/components/step-by-step-nav

//= require_tree ./modules
1 change: 1 addition & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ $govuk-new-link-styles: true;
@import 'govuk_publishing_components/components/radio';
@import 'govuk_publishing_components/components/related-navigation';
@import 'govuk_publishing_components/components/share-links';
@import 'govuk_publishing_components/components/single-page-notification-button';
@import 'govuk_publishing_components/components/step-by-step-nav';
@import 'govuk_publishing_components/components/step-by-step-nav-header';
@import 'govuk_publishing_components/components/step-by-step-nav-related';
Expand Down
15 changes: 14 additions & 1 deletion app/views/content_items/publication.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
</div>

<%= render 'shared/publisher_metadata_with_logo' %>
<%= render 'govuk_publishing_components/components/single_page_notification_button', {
base_path: @content_item.base_path,
js_enhancement: @include_single_page_notification_button_js,
margin_bottom: 6,
button_location: "top",
} if @notification_button_visible %>
<%= render 'shared/history_notice', content_item: @content_item %>

<%= render 'govuk_publishing_components/components/notice', @content_item.withdrawal_notice_component %>
Expand Down Expand Up @@ -53,8 +59,15 @@
<%= render 'components/published-dates', {
published: @content_item.published,
last_updated: @content_item.updated,
history: @content_item.history
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 %>
</div>
</div>
<%= render 'shared/sidebar_navigation' %>
Expand Down
6 changes: 5 additions & 1 deletion app/views/shared/_publisher_metadata_with_logo.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<%
metadata_component_options = @content_item.publisher_metadata
metadata_component_options[:margin_bottom] = 3 if @notification_button_visible
%>
<div class="govuk-grid-row">
<div class="metadata-logo-wrapper<%= ' responsive-bottom-margin' if @content_item.try(:logo) %>">
<div class="govuk-grid-column-two-thirds metadata-column">
<%= render 'govuk_publishing_components/components/metadata', @content_item.publisher_metadata %>
<%= render 'govuk_publishing_components/components/metadata', metadata_component_options %>
</div>
<div class="govuk-grid-column-one-third">
<% if @content_item.try(:logo) %>
Expand Down

0 comments on commit 4c883d1

Please sign in to comment.