Skip to content

Commit

Permalink
Update print this page logic
Browse files Browse the repository at this point in the history
  • Loading branch information
martikat committed Apr 10, 2024
1 parent 9ef27c5 commit d519c7f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
8 changes: 2 additions & 6 deletions app/views/pages/default.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
| Contents on this page
= m(page.content_list)

div class='gem-c-print-link print-button govuk-!-margin-top-7'
button.govuk-link.print-link-button class="govuk-link gem-c-print-link__button" onclick="window.print()" data-module="print-link"
| Print this page
= render 'shared/print'

.govuk-grid-row class='govuk-!-margin-top-4 govuk-!-margin-bottom-5'
.govuk-grid-column-full
Expand All @@ -35,8 +33,6 @@
dd.gem-c-metadata__definition data-module="ga4-link-tracker" data-ga4-track-links-only="" data-ga4-link="{"event_name":"navigation","type":"content history","section":"Top","action":"opened"}" data-ga4-link-tracker-module-started="true" #{page.updated_at.to_s(:long)}

- if page.content_list.present?
div class='gem-c-print-link print-button govuk-!-margin-top-7'
button.govuk-link.print-link-button class='govuk-link gem-c-print-link__button' onclick='window.print()' data-module='print-link'
| Print this page
= render 'shared/print'

= render 'shared/ctas'
8 changes: 2 additions & 6 deletions app/views/pages/side_nav.slim
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,11 @@
| Contents on this page
= m(page.content_list)

div class='gem-c-print-link print-button govuk-!-margin-top-7'
button.govuk-link.print-link-button class='govuk-link gem-c-print-link__button' onclick='window.print()' data-module='print-link'
| Print this page
= render 'shared/print'

= m(page.body)

- if page.content_list.present?
div class='gem-c-print-link print-button govuk-!-margin-top-7'
button.govuk-link.print-link-button class='govuk-link gem-c-print-link__button' onclick='window.print()' data-module='print-link'
| Print this page
= render 'shared/print'

= render 'shared/ctas'
3 changes: 3 additions & 0 deletions app/views/shared/_print.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
div class='govuk-!-margin-top-7'
button.govuk-link.print-link-button onclick='window.print()' data-module='print-link'
| Print this page

0 comments on commit d519c7f

Please sign in to comment.