Skip to content

Commit

Permalink
Add print button to html publications
Browse files Browse the repository at this point in the history
  • Loading branch information
Dilwoar Hussain committed Oct 30, 2020
1 parent 57bb9b8 commit 1b4c3b9
Show file tree
Hide file tree
Showing 2 changed files with 16 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
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 1b4c3b9

Please sign in to comment.