-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4428 from DFE-Digital/2084-tda-find-update-initia…
…l-questions-and-filters-on-find TDA find - Add undergraduate courses to find (for 2025 cycle)
- Loading branch information
Showing
24 changed files
with
921 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
app/controllers/find/search/no_degree_and_requires_visa_sponsorship_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
module Find | ||
module Search | ||
class NoDegreeAndRequiresVisaSponsorshipController < Find::ApplicationController | ||
def back_path | ||
find_visa_status_path(backlink_query_parameters) | ||
end | ||
helper_method :back_path | ||
|
||
# this controller is an exit page, so returning the latest form | ||
def form_name = :find_visa_status_form | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
app/controllers/find/search/university_degree_status_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# frozen_string_literal: true | ||
|
||
module Find | ||
module Search | ||
class UniversityDegreeStatusController < Find::ApplicationController | ||
include FilterParameters | ||
|
||
def new | ||
@university_degree_status_form = UniversityDegreeStatusForm.new( | ||
university_degree_status: params[:university_degree_status] | ||
) | ||
end | ||
|
||
def create | ||
@university_degree_status_form = UniversityDegreeStatusForm.new( | ||
university_degree_status: form_params[:university_degree_status] | ||
) | ||
|
||
if @university_degree_status_form.valid? | ||
redirect_to find_visa_status_path(filter_params[:find_university_degree_status_form]) | ||
else | ||
render :new | ||
end | ||
end | ||
|
||
def form_name = :find_university_degree_status_form | ||
|
||
def back_path | ||
find_subjects_path(backlink_query_parameters) | ||
end | ||
helper_method :back_path | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
module Find | ||
class UniversityDegreeStatusForm | ||
include ActiveModel::Model | ||
attr_accessor :university_degree_status | ||
|
||
validates :university_degree_status, presence: true | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# frozen_string_literal: true | ||
|
||
module Find | ||
class CourseTypeAnswerDeterminer | ||
attr_reader :age_group, :visa_status, :university_degree_status | ||
|
||
def initialize(age_group:, visa_status:, university_degree_status:) | ||
@age_group = age_group | ||
@visa_status = visa_status | ||
@university_degree_status = university_degree_status | ||
end | ||
|
||
def show_undergraduate_courses? | ||
!further_education? && university_degree_question_answered? && no_degrees? && does_not_require_visa_sponsorship? | ||
end | ||
|
||
def show_exit_page? | ||
!further_education? && university_degree_question_answered? && no_degrees? && require_visa_sponsorship? | ||
end | ||
|
||
private | ||
|
||
def university_degree_question_answered? | ||
university_degree_status.present? | ||
end | ||
|
||
def further_education? | ||
age_group == 'further_education' | ||
end | ||
|
||
def require_visa_sponsorship? | ||
ActiveModel::Type::Boolean.new.cast(visa_status) | ||
end | ||
|
||
def does_not_require_visa_sponsorship? | ||
!require_visa_sponsorship? | ||
end | ||
|
||
def no_degrees? | ||
!degrees? | ||
end | ||
|
||
def degrees? | ||
ActiveModel::Type::Boolean.new.cast(university_degree_status) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
app/views/find/search/no_degree_and_requires_visa_sponsorship/new.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<%= content_for :page_title, t("find.no_degree_and_requires_visa_sponsorship_page.title") %> | ||
|
||
<% content_for :before_content do %> | ||
<%= govuk_back_link( | ||
text: "Back", | ||
href: back_path, | ||
html_attributes: { | ||
data: { qa: "page-back" } | ||
} | ||
) %> | ||
<% end %> | ||
|
||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<h1 class="govuk-heading-l"> | ||
<%= t("find.no_degree_and_requires_visa_sponsorship_page.title") %>. | ||
</h1> | ||
|
||
<p class="govuk-body"> | ||
<%= t("find.no_degree_and_requires_visa_sponsorship_page.content") %> | ||
</p> | ||
|
||
<p class="govuk-body"> | ||
<%= t( | ||
"find.no_degree_and_requires_visa_sponsorship_page.explanation", | ||
link: govuk_link_to( | ||
t("find.get_into_teaching.undergraduate_degree_courses"), | ||
t("find.get_into_teaching.url_ways_to_train_no_degree") | ||
) | ||
).html_safe %> | ||
</p> | ||
</div> | ||
</div> |
Oops, something went wrong.