diff --git a/app/models/country.rb b/app/models/country.rb index dee052dcb8..147a618337 100644 --- a/app/models/country.rb +++ b/app/models/country.rb @@ -33,4 +33,7 @@ class Country < ApplicationRecord YAML.load(File.read("lib/countries-in-european-economic-area.yaml")) validates :code, inclusion: { in: CODES } + + alias_attribute :teaching_qualification_information, + :qualifications_information end diff --git a/app/models/region.rb b/app/models/region.rb index ac39814e3b..f7ec7393bb 100644 --- a/app/models/region.rb +++ b/app/models/region.rb @@ -60,6 +60,9 @@ class Region < ApplicationRecord } validates :teaching_authority_online_checker_url, url: { allow_blank: true } + alias_attribute :teaching_qualification_information, + :qualifications_information + def checks_available? !sanction_check_none? && !status_check_none? end diff --git a/app/views/shared/_teaching_qualification_information.html.erb b/app/views/shared/_teaching_qualification_information.html.erb new file mode 100644 index 0000000000..b94a3fc6d8 --- /dev/null +++ b/app/views/shared/_teaching_qualification_information.html.erb @@ -0,0 +1,7 @@ +<% if region.teaching_qualification_information.present? %> + <%= raw GovukMarkdown.render(region.teaching_qualification_information) %> +<% end %> + +<% if region.country.teaching_qualification_information.present? %> + <%= raw GovukMarkdown.render(region.country.teaching_qualification_information) %> +<% end %> diff --git a/app/views/shared/eligible_region_content_components/_proof_of_qualifications.html.erb b/app/views/shared/eligible_region_content_components/_proof_of_qualifications.html.erb index 37952d5e52..d67eb081a8 100644 --- a/app/views/shared/eligible_region_content_components/_proof_of_qualifications.html.erb +++ b/app/views/shared/eligible_region_content_components/_proof_of_qualifications.html.erb @@ -31,10 +31,4 @@

<% end %> -<% if region.qualifications_information.present? %> - <%= raw GovukMarkdown.render(region.qualifications_information) %> -<% end %> - -<% if region.country.qualifications_information.present? %> - <%= raw GovukMarkdown.render(region.country.qualifications_information) %> -<% end %> +<%= render "shared/teaching_qualification_information", region: %> diff --git a/app/views/shared/support_interface/_country_region_information_fields.html.erb b/app/views/shared/support_interface/_country_region_information_fields.html.erb index 8bc61fdba1..b15f1cb996 100644 --- a/app/views/shared/support_interface/_country_region_information_fields.html.erb +++ b/app/views/shared/support_interface/_country_region_information_fields.html.erb @@ -3,7 +3,7 @@ <%= f.govuk_fieldset legend: { text: "Proof of qualifications", size: "s" } do %>

Example: ‘We cannot accept the National Certificate in Education (NCE) or the Teachers Certificate Grade II from Nigeria, as these do not meet the required level.’

- <%= f.govuk_text_area :qualifications_information, label: { text: "Qualifications" }, rows: 5 %> + <%= f.govuk_text_area :qualifications_information, label: { text: "For the teaching qualification" }, rows: 5 %> <% end %> <%= f.govuk_fieldset legend: { text: "Proof that you’re recognised as a teacher", size: "s" } do %> diff --git a/app/views/teacher_interface/qualifications/_form.html.erb b/app/views/teacher_interface/qualifications/_form.html.erb index 5bd68ebadd..b263b50688 100644 --- a/app/views/teacher_interface/qualifications/_form.html.erb +++ b/app/views/teacher_interface/qualifications/_form.html.erb @@ -28,17 +28,7 @@

Add any additional qualifications you have that relate to your teaching career. These must be of a <%= govuk_link_to "UK ‘level 6’ equivalent or above", "https://www.gov.uk/what-different-qualification-levels-mean/list-of-qualification-levels" %>.

<% end %> - <% if @application_form.region.qualifications_information.present? || @application_form.region.country.qualifications_information.present? %> -
- <% if @application_form.region.qualifications_information.present? %> - <%= raw GovukMarkdown.render(@application_form.region.qualifications_information) %> - <% end %> - - <% if @application_form.region.country.qualifications_information.present? %> - <%= raw GovukMarkdown.render(@application_form.region.country.qualifications_information) %> - <% end %> -
- <% end %> + <%= render "shared/teaching_qualification_information", region: @application_form.region %> <%= f.govuk_fieldset legend: { text: t(qualification.locale_key, scope: %i[application_form qualifications form title]) } do %> <%= f.govuk_text_field :title, diff --git a/spec/support/autoload/page_objects/teacher_interface/qualification_form.rb b/spec/support/autoload/page_objects/teacher_interface/qualification_form.rb index 55eb4f37dc..b222585b43 100644 --- a/spec/support/autoload/page_objects/teacher_interface/qualification_form.rb +++ b/spec/support/autoload/page_objects/teacher_interface/qualification_form.rb @@ -5,7 +5,6 @@ module TeacherInterface class QualificationForm < SitePrism::Page element :heading, "h1" element :body, ".govuk-body-l" - element :qualifications_information, "#app-qualifications-information" section :form, "form" do element :title_field,