Skip to content

Commit 4216f24

Browse files
committed
Add sections to AppVaccinateFormComponent
This should improve the accessibility of the page by ensuring that the pre-screening and vaccination sections are considered separate.
1 parent c2242bf commit 4216f24

File tree

1 file changed

+49
-45
lines changed

1 file changed

+49
-45
lines changed

app/components/app_vaccinate_form_component.html.erb

Lines changed: 49 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -8,63 +8,67 @@
88
<% content_for(:before_content) { f.govuk_error_summary } %>
99

1010
<div class="nhsuk-card__content">
11-
<h2 class="nhsuk-card__heading nhsuk-heading-m">
12-
Pre-screening checks
13-
</h2>
11+
<section>
12+
<h2 class="nhsuk-card__heading nhsuk-heading-m">
13+
Pre-screening checks
14+
</h2>
1415

15-
<p><%= patient.given_name %> has confirmed that they:</p>
16+
<p><%= patient.given_name %> has confirmed that they:</p>
1617

17-
<ul class="nhsuk-list nhsuk-list--bullet">
18-
<li>are not acutely unwell</li>
19-
<% if vaccinate_form.ask_not_pregnant? %>
20-
<li>are not pregnant</li>
21-
<% end %>
22-
<% if vaccinate_form.ask_not_taking_medication? %>
23-
<li>are not taking any medication which prevents vaccination</li>
24-
<% end %>
25-
<li>have no allergies which would prevent vaccination</li>
26-
<li>have not already had this vaccination</li>
27-
<li>know what the vaccination is for, and are happy to have it</li>
28-
</ul>
18+
<ul class="nhsuk-list nhsuk-list--bullet">
19+
<li>are not acutely unwell</li>
20+
<% if vaccinate_form.ask_not_pregnant? %>
21+
<li>are not pregnant</li>
22+
<% end %>
23+
<% if vaccinate_form.ask_not_taking_medication? %>
24+
<li>are not taking any medication which prevents vaccination</li>
25+
<% end %>
26+
<li>have no allergies which would prevent vaccination</li>
27+
<li>have not already had this vaccination</li>
28+
<li>know what the vaccination is for, and are happy to have it</li>
29+
</ul>
2930

30-
<%= f.govuk_check_boxes_fieldset :pre_screening_confirmed, multiple: false, legend: nil do %>
31-
<%= f.govuk_check_box :pre_screening_confirmed, 1, 0, multiple: false, link_errors: true,
32-
label: { text: "#{patient.given_name} has confirmed the above statements are true" } %>
33-
<% end %>
31+
<%= f.govuk_check_boxes_fieldset :pre_screening_confirmed, multiple: false, legend: nil do %>
32+
<%= f.govuk_check_box :pre_screening_confirmed, 1, 0, multiple: false, link_errors: true,
33+
label: { text: "#{patient.given_name} has confirmed the above statements are true" } %>
34+
<% end %>
3435

35-
<%= f.govuk_text_area :pre_screening_notes, label: { text: "Pre-screening notes (optional)" }, rows: 3 %>
36+
<%= f.govuk_text_area :pre_screening_notes, label: { text: "Pre-screening notes (optional)" }, rows: 3 %>
37+
</section>
3638

3739
<hr class="nhsuk-section-break nhsuk-section-break--visible nhsuk-section-break--l">
3840

39-
<h2 class="nhsuk-card__heading nhsuk-heading-m">
40-
Is <%= patient.given_name %> ready for their <%= programme.name %> vaccination?
41-
</h2>
41+
<section>
42+
<h2 class="nhsuk-card__heading nhsuk-heading-m">
43+
Is <%= patient.given_name %> ready for their <%= programme.name %> vaccination?
44+
</h2>
4245

43-
<% hint = "Pre-screening checks must be completed for vaccination to go ahead" %>
46+
<% hint = "Pre-screening checks must be completed for vaccination to go ahead" %>
4447

45-
<%= f.govuk_radio_buttons_fieldset :administered, legend: nil do %>
46-
<% if common_delivery_sites_options.length > 1 %>
47-
<%= f.govuk_radio_button :administered, true, label: { text: "Yes" }, hint: { text: hint }, link_errors: true do %>
48-
<%= f.govuk_collection_radio_buttons :delivery_site,
49-
common_delivery_sites_options,
50-
:value,
51-
:label,
52-
legend: {
53-
text: "Where will the injection be given?",
54-
size: "s",
55-
} %>
48+
<%= f.govuk_radio_buttons_fieldset :administered, legend: nil do %>
49+
<% if common_delivery_sites_options.length > 1 %>
50+
<%= f.govuk_radio_button :administered, true, label: { text: "Yes" }, hint: { text: hint }, link_errors: true do %>
51+
<%= f.govuk_collection_radio_buttons :delivery_site,
52+
common_delivery_sites_options,
53+
:value,
54+
:label,
55+
legend: {
56+
text: "Where will the injection be given?",
57+
size: "s",
58+
} %>
59+
<% end %>
60+
<% else %>
61+
<%= f.govuk_radio_button :administered, true, label: { text: "Yes" }, hint: { text: hint }, link_errors: true %>
62+
<%= f.hidden_field :delivery_site, value: common_delivery_sites_options.first.value %>
5663
<% end %>
57-
<% else %>
58-
<%= f.govuk_radio_button :administered, true, label: { text: "Yes" }, hint: { text: hint }, link_errors: true %>
59-
<%= f.hidden_field :delivery_site, value: common_delivery_sites_options.first.value %>
64+
<%= f.govuk_radio_button :administered, false, label: { text: "No" } %>
6065
<% end %>
61-
<%= f.govuk_radio_button :administered, false, label: { text: "No" } %>
62-
<% end %>
6366

64-
<%= f.hidden_field :delivery_method, value: delivery_method %>
65-
<%= f.hidden_field :dose_sequence, value: dose_sequence %>
66-
<%= f.hidden_field :programme_id, value: programme.id %>
67+
<%= f.hidden_field :delivery_method, value: delivery_method %>
68+
<%= f.hidden_field :dose_sequence, value: dose_sequence %>
69+
<%= f.hidden_field :programme_id, value: programme.id %>
6770

68-
<%= f.govuk_submit "Continue" %>
71+
<%= f.govuk_submit "Continue" %>
72+
</section>
6973
</div>
7074
<% end %>

0 commit comments

Comments
 (0)