Skip to content

Commit 012df60

Browse files
committed
Add content to show when there are no session dates
When moving a patient to either a community clinic or a school session, if the upcoming session hasn't been closed but it's also got no dates, the content should be reflected to show that.
1 parent 6f4a73c commit 012df60

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/views/school_moves/show.html.erb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@
4242
<%= f.govuk_radio_buttons_fieldset :action, legend: { text: "Update the child’s record with this new information?" } do %>
4343
<%= f.govuk_radio_button :action, :confirm, label: { text: "Update record with new school" }, link_errors: true do %>
4444
<% if @form.show_move_to_school? %>
45-
<% hint = if @school_move.school_session.today_or_future_dates.count == 1
45+
<% hint = if @school_move.school_session.today_or_future_dates.count == 0
46+
"There is an unscheduled session at #{@school_move.school_session.location.name}."
47+
elsif @school_move.school_session.today_or_future_dates.count == 1
4648
"There is an upcoming session at #{@school_move.school_session.location.name} on #{@school_move.school_session.today_or_future_dates.first.to_fs(:long)}."
4749
else
4850
"There are upcoming sessions at #{@school_move.school_session.location.name} on #{@school_move.school_session.today_or_future_dates.map { _1.to_fs(:long) }.to_sentence}."

0 commit comments

Comments
 (0)