Skip to content

Commit

Permalink
Display warning text related to printing
Browse files Browse the repository at this point in the history
We want to make the user aware of their responsibilities relating to
printing information they have searched for.

This introduces a warning that is visible only when viewed in a browser
and not on the printed version of the page.
felixclack committed Jul 26, 2024
1 parent c644345 commit f720d7c
Showing 3 changed files with 24 additions and 7 deletions.
6 changes: 6 additions & 0 deletions app/assets/stylesheets/check_records.scss
Original file line number Diff line number Diff line change
@@ -112,3 +112,9 @@ h1 .govuk-tag {
max-width: 100%;
}
}

@media print {
.app__no-print {
display: none;
}
}
20 changes: 13 additions & 7 deletions app/views/check_records/teachers/show.html.erb
Original file line number Diff line number Diff line change
@@ -39,6 +39,12 @@
<% @other_qualifications.each do |qualification| %>
<%= render CheckRecords::QualificationSummaryComponent.new(qualification:) %>
<% end %>

<%= govuk_inset_text classes: "govuk-!-padding-bottom-2 govuk-!-padding-top-3 govuk-!-margin-bottom- govuk-!-margin-top-0 app__no-print" do %>
<div class="govuk-!-margin-bottom-1">
You should review the terms and conditions before printing this page. You should dispose of the offline records you maintain once they have served their purpose.
</div>
<% end %>
</div>

<div class="govuk-grid-column-one-third">
@@ -60,12 +66,12 @@
<% end %>

<% if @teacher.date_of_birth.present? %>
<li>
<h4>Date of birth</h4>
</li>
<li>
<p><%= Date.parse(@teacher.date_of_birth).to_fs(:long) %></p>
</li>
<li>
<h4>Date of birth</h4>
</li>
<li>
<p><%= Date.parse(@teacher.date_of_birth).to_fs(:long) %></p>
</li>
<% end %>

<% if @teacher.previous_names.present? %>
@@ -78,4 +84,4 @@
<% end %>
</ul>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@
then_i_see_mq_details
then_i_see_previous_last_names
and_a_viewed_timestamp_is_displayed
and_a_print_warning_is_displayed
end

private
@@ -118,4 +119,8 @@ def and_a_search_timestamp_is_displayed
def and_a_viewed_timestamp_is_displayed
expect(page).to have_content "Viewed at #{@frozen_time.strftime("%-I:%M%P on %-d %B %Y")}"
end

def and_a_print_warning_is_displayed
expect(page).to have_content "You should dispose of the offline records"
end
end

0 comments on commit f720d7c

Please sign in to comment.