Skip to content

Commit

Permalink
Merge pull request #759 from DFE-Digital/warning-text
Browse files Browse the repository at this point in the history
Display warning text related to printing
  • Loading branch information
felixclack authored Jul 26, 2024
2 parents c644345 + f720d7c commit c761248
Show file tree
Hide file tree
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
Expand Up @@ -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
Expand Up @@ -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">
Expand All @@ -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? %>
Expand All @@ -78,4 +84,4 @@
<% end %>
</ul>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 c761248

Please sign in to comment.