Skip to content

Commit

Permalink
Merge pull request #1889 from alphagov/add-print-link-to-detailed-guides
Browse files Browse the repository at this point in the history
Add print link to detailed guides
  • Loading branch information
DilwoarH authored Oct 30, 2020
2 parents 2324164 + 1b4c3b9 commit 7341f64
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/assets/stylesheets/views/_html-publication.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@
display: none;
}

.govuk-sticky-element {
.govuk-sticky-element__print-link {
margin-left: govuk-spacing(3);
}
}

@include govuk-media-query($until: desktop) {
.govuk-sticky-element--enabled {
position: static;
Expand Down
8 changes: 8 additions & 0 deletions app/views/content_items/detailed_guide.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
<%= render 'components/important-metadata', items: @content_item.important_metadata %>

<%= render "components/contents-list-with-body", contents: @content_item.contents do %>
<%= render "govuk_publishing_components/components/print_link", {
margin_top: 0,
margin_bottom: 6,
} %>
<%= render 'govuk_publishing_components/components/govspeak', @content_item.govspeak_body %>

<div class="responsive-bottom-margin">
Expand All @@ -34,6 +38,10 @@
} %>
</div>
<% end %>
<%= render "govuk_publishing_components/components/print_link", {
margin_top: 0,
margin_bottom: 6,
} %>
</div>
<%= render 'shared/sidebar_navigation' %>
</div>
Expand Down
10 changes: 10 additions & 0 deletions app/views/content_items/html_publication.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
<% if @content_item.contents.any? %>
<div class="govuk-grid-column-one-quarter-from-desktop contents-list-container">
<%= render 'govuk_publishing_components/components/contents_list', contents: @content_item.contents, format_numbers: true %>
<%= render "govuk_publishing_components/components/print_link", {
margin_top: 0,
margin_bottom: 6,
} %>
</div>
<% end %>

Expand All @@ -58,5 +62,11 @@

<div data-sticky-element class="govuk-sticky-element">
<%= render 'components/back-to-top', href: "#contents" %>
<div class="govuk-sticky-element__print-link">
<%= render "govuk_publishing_components/components/print_link", {
margin_top: 0,
margin_bottom: 6,
} %>
</div>
</div>
</div>

0 comments on commit 7341f64

Please sign in to comment.