Skip to content

Commit

Permalink
Nest subject fields
Browse files Browse the repository at this point in the history
  • Loading branch information
avinhurry committed May 9, 2024
1 parent e87b471 commit 3d06531
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions app/views/publish/courses/_a_level_requirements.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
<%= f.govuk_radio_buttons_fieldset :a_levels, legend: { text: "Are any A levels required for this course?" } do %>
<%= f.govuk_radio_button :a_levels, true,
checked: course_object.a_levels,
label: { text: "Yes" }, data: { qa: "a_levels" }, link_errors: true %>

<%= f.govuk_radio_button :a_levels, false,
checked: course_object.a_levels == false,
label: { text: "No" }, data: { qa: "a_levels" } %>
<% end %>
label: { text: "Yes" }, data: { qa: "a_levels" }, link_errors: true do %>

<%= f.govuk_radio_buttons_fieldset :a_levels_two, legend: { text: "Subject" } do %>
<%= f.govuk_radio_buttons_fieldset :a_levels_two, legend: { text: "Subject" } do %>
<%= f.govuk_radio_button :a_levels_two, true,
checked: course_object.a_levels,
label: { text: "Any subject" }, data: { qa: "a_levels" }, link_errors: true %>
Expand All @@ -29,17 +24,24 @@
checked: course_object.a_levels == false,
label: { text: "Any science subject" }, data: { qa: "a_levels" } %>

<%= f.govuk_text_field :a_levels_three,
value: course_object.additional_gcse_equivalencies,
label: { text: "Minimum grade required (optional)", size: "m" },
width: 10 %>

<%= f.govuk_radio_divider %>

<%= f.govuk_radio_button :a_levels_two, "non_uk", label: { text: "Choose a subject" } do %>
<%= f.govuk_collection_select :subjects, @course.a_level_selectable_subjects, :id, :name, label: { text: "", size: "s" } %>
<% end %>
<% end %>

<%= f.govuk_text_field :a_levels_three,
value: course_object.additional_gcse_equivalencies,
label: { text: "Minimum grade required (optional)", size: "m" },
width: 10 %>
<% end %>

<%= f.govuk_radio_button :a_levels, false,
checked: course_object.a_levels == false,
label: { text: "No" }, data: { qa: "a_levels" } %>
<% end %>

<%= govuk_button_link_to("Add another A level", "#", class: "govuk-button--secondary") %>

Expand Down

0 comments on commit 3d06531

Please sign in to comment.