Skip to content

Commit

Permalink
Wip
Browse files Browse the repository at this point in the history
  • Loading branch information
CatalinVoineag committed Jul 11, 2024
1 parent 87ba27f commit 8bae92f
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<div class="govuk-!-margin-bottom-8">
<h2 class="govuk-heading-l" id="section-international-students">International candidates</h2>
<%= govuk_details(summary_text: visa_sponsorship_summary) do %>
<div data-qa="course__international_students">

<% if apprenticeship? %>
Expand All @@ -10,16 +9,21 @@
EEA, Switzerland, Gibraltar, or the UK for at least the previous 3 years will also be eligible.</p>
<% end %>

<p class="govuk-body"><%= apprenticeship? ? "You’ll also" : "You’ll" %> need the <%= right_required %> in the UK. You already have this if, for example, you:</p>
<p class="govuk-body"><%= apprenticeship? ? "You’ll also" : "You’ll" %> need the <%= right_required %> in the UK</p>

<p class="govuk-body">You already have this if, for example, you:</p>

<ul class="govuk-list govuk-list--bullet">
<li>are an Irish citizen</li>
<li>have settled or pre-settled status under the <%= govuk_link_to("EU Settlement Scheme", t("links.eu_settlement_scheme")) %> (you may still be able to apply)</li>
<li>have indefinite leave to remain in the UK</li>
</ul>

<%= t("find.international_candidates.#{visa_type}.#{sponsorship_availability}.html") %>
<%= t(
"find.international_candidates.#{visa_type}.#{sponsorship_availability}.html",
provider_url: x_provider_url
) %>

<p class="govuk-body">Learn more about <%= govuk_link_to("training to teach in England as an international student", t("find.get_into_teaching.url_train_to_teach_as_international_candidate")) %>.</p>
</div>
</div>
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ module Find
module Courses
module InternationalStudentsComponent
class View < ViewComponent::Base
include ::ViewHelper
include PreviewHelper
attr_reader :course

delegate :apprenticeship?, to: :course
delegate :apprenticeship?,
:salaried?,
:can_sponsor_student_visa,
:can_sponsor_skilled_worker_visa,
to: :course

def initialize(course:)
super
Expand All @@ -32,6 +38,16 @@ def sponsorship_availability
def course_subject_codes
@course_subject_codes ||= course.subjects.pluck(:subject_code).compact
end

def visa_sponsorship_summary
if !salaried? && can_sponsor_student_visa
t('.student_visas_can_be_sponsored')
elsif salaried? && can_sponsor_skilled_worker_visa
t('.skilled_worker_visas_can_be_sponsored')
else
t('.visas_cannot_be_sponsored')
end
end
end
end
end
Expand Down
4 changes: 3 additions & 1 deletion app/components/find/courses/summary_component/view.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@

<% summary_list.with_row do |row| %>
<% row.with_key(text: t(".visa_sponsorship")) %>
<% row.with_value(text: visa_sponsorship_row) %>
<% row.with_value do %>
<%= render Find::Courses::InternationalStudentsComponent::View.new(course:) %>
<% end %>
<% end %>
<% end %>
24 changes: 24 additions & 0 deletions app/helpers/view_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,30 @@ def classnames(*args)

alias cns classnames

def x_provider_url
if preview?(params)
provider_publish_provider_recruitment_cycle_course_path(
course.provider_code,
course.recruitment_cycle_year,
course.course_code
)
else
find_provider_path(course.provider_code, course.course_code)
end
end

def x_accrediting_provider_url
if preview?(params)
accredited_by_publish_provider_recruitment_cycle_course_path(
course.provider_code,
course.recruitment_cycle_year,
course.course_code
)
else
find_accrediting_provider_path(course.provider_code, course.course_code)
end
end

private

def base_errors_hash(provider_code, course)
Expand Down
2 changes: 0 additions & 2 deletions app/views/find/courses/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@
<%= render partial: "find/courses/interview_process", locals: { course: @course } %>
<% end %>

<%= render Find::Courses::InternationalStudentsComponent::View.new(course: @course) %>

<% if @provider.train_with_disability.present? %>
<h2 class="govuk-heading-l" id="section-train-with-disabilities">
<%= t(".training_with_disabilities") %>
Expand Down
2 changes: 0 additions & 2 deletions app/views/publish/courses/preview.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
<%= render partial: "find/courses/interview_process", locals: { course: } %>
<% end %>

<%= render Find::Courses::InternationalStudentsComponent::View.new(course:) %>

<h2 class="govuk-heading-l" id="section-train-with-disabilities">
<%= t(".training_with_disabilities") %>
</h2>
Expand Down
23 changes: 11 additions & 12 deletions config/locales/find.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ en:
courses:
train_with_disabilities:
heading: Training with disabilities and other needs at %{provider_name}
international_students_component:
view:
student_visas_can_be_sponsored: Student visas can be sponsored
skilled_worker_visas_can_be_sponsored: Skilled Worker visas can be sponsored
visas_cannot_be_sponsored: Visas cannot be sponsored
summary_component:
view:
fee_or_salary: Fee or salary
Expand Down Expand Up @@ -149,27 +154,21 @@ en:
skilled_worker_visa:
not_available:
html:
<p class="govuk-body">If you do not already have the right to work in the UK, you may need to apply for a visa. The main visa for salaried courses is the <a class="govuk-link" href="https://www.gov.uk/skilled-worker-visa">Skilled Worker visa.</a></p>
<p class="govuk-body">Sponsorship for a Skilled Worker visa is not available for this course.</p>
<p class="govuk-body">If you need a visa, filter your course search to find courses with visa sponsorship.</p>
<p class="govuk-body">You can also <a class="govuk-link" href="https://getintoteaching.education.gov.uk/non-uk-teachers/visas-for-non-uk-trainees">learn more about different types of visa</a> which allow you to train to be a teacher without being sponsored.</p>
<p class="govuk-body">If you do not already have the right to study in the UK, you may need to <a class="govuk-link" href="https://getintoteaching.education.gov.uk/non-uk-teachers/visas-for-non-uk-trainees"> apply for your visa to train to teach in England </a>.</p>
available:
html:
<p class="govuk-body">If you do not already have the right to work in the UK for the duration of this course, you may need to apply for a Skilled Worker visa.</p>
<p class="govuk-body">If you do not already have the right to work in the UK, you may need to <a class="govuk-link" href="https://getintoteaching.education.gov.uk/non-uk-teachers/visas-for-non-uk-trainees"> apply for your visa to train to teach in England </a>.</p>
<p class="govuk-body">To do this, you’ll need to be sponsored by your employer.</p>
<p class="govuk-body">Before you apply for this course, contact us to check Skilled Worker visa sponsorship is available. If it is, and you get a place on this course, well help you apply for your visa.</p>
<p class="govuk-body">Before you apply for this course, <a class="govuk-link" href=%{provider_url}>contact the training provider</a> to check Skilled Worker visa sponsorship is available. If it is, and you get a place on this course, we'll help you apply for your visa.</p>
student_visa:
not_available:
html:
<p class="govuk-body">If you do not already have the right to study in the UK, you may need to apply for a visa.</p>
<p class="govuk-body">Sponsorship for a student visa is not available for this course.</p>
<p class="govuk-body">If you need a visa, filter your course search to find courses with visa sponsorship.</p>
<p class="govuk-body">You can also <a class="govuk-link" href="https://getintoteaching.education.gov.uk/non-uk-teachers/visas-for-non-uk-trainees">learn more about different types of visa</a> which allow you to train to be a teacher without being sponsored.</p>
<p class="govuk-body">If you do not already have the right to study in the UK, you may need to <a class="govuk-link" href="https://getintoteaching.education.gov.uk/non-uk-teachers/visas-for-non-uk-trainees"> apply for your visa to train to teach in England </a>.</p>
available:
html:
<p class="govuk-body">If you do not already have the right to study in the UK for the duration of this course, you may need to apply for a Student visa.</p>
<p class="govuk-body">If you do not already have the right to study in the UK, you may need to <a class="govuk-link" href="https://getintoteaching.education.gov.uk/non-uk-teachers/visas-for-non-uk-trainees"> apply for your visa to train to teach in England </a>.</p>
<p class="govuk-body">To do this, you’ll need to be sponsored by your training provider.</p>
<p class="govuk-body">Before you apply for this course, contact us to check Student visa sponsorship is available. If it is, and you get a place on this course, we’ll help you apply for your visa.</p>
<p class="govuk-body">Before you apply for this course, <a class="govuk-link" href=%{provider_url}>contact the training provider</a> to check Student visa sponsorship is available. If it is, and you get a place on this course, we’ll help you apply for your visa.</p>
entitlement:
html:
<p class="govuk-body">You may be entitled to £10,000 from the UK government to help with the financial costs of moving to England.</p>
Expand Down

0 comments on commit 8bae92f

Please sign in to comment.