-
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 #4284 from DFE-Digital/1749-ensure-back-links-redi…
…rect-correctly-on-tda-courses-part-2 [1749] Ensure back links redirect correctly on TDA courses
- Loading branch information
Showing
10 changed files
with
257 additions
and
66 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# frozen_string_literal: true | ||
|
||
module Publish | ||
module BackLinkHelper | ||
def visa_path(course) | ||
if previously_basic_details? | ||
details_publish_provider_recruitment_cycle_course_path( | ||
course.provider_code, | ||
course.recruitment_cycle_year, | ||
course.course_code | ||
) | ||
elsif previously_tda_course? | ||
full_part_time_publish_provider_recruitment_cycle_course_path( | ||
course.provider_code, | ||
course.recruitment_cycle_year, | ||
course.course_code, | ||
previous_tda_course: true | ||
) | ||
elsif course.provider.accredited_provider? | ||
apprenticeship_publish_provider_recruitment_cycle_course_path( | ||
course.provider_code, | ||
course.recruitment_cycle_year, | ||
course.course_code | ||
) | ||
else | ||
funding_type_publish_provider_recruitment_cycle_course_path( | ||
course.provider_code, | ||
course.recruitment_cycle_year, | ||
course.course_code | ||
) | ||
end | ||
end | ||
|
||
def study_mode_path(course) | ||
if previously_tda_course? | ||
funding_type_publish_provider_recruitment_cycle_course_path( | ||
course.provider_code, | ||
course.recruitment_cycle_year, | ||
course.course_code, | ||
previous_tda_course: true | ||
) | ||
else | ||
|
||
details_publish_provider_recruitment_cycle_course_path( | ||
course.provider_code, | ||
course.recruitment_cycle_year, | ||
course.course_code | ||
) | ||
|
||
end | ||
end | ||
|
||
private | ||
|
||
def previously_tda_course? | ||
params[:previous_tda_course] == 'true' | ||
end | ||
|
||
def previously_basic_details? | ||
params[:back_to_basic_details].present? | ||
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
26 changes: 1 addition & 25 deletions
26
app/views/publish/courses/skilled_worker_visa_sponsorship/edit.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
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
26 changes: 1 addition & 25 deletions
26
app/views/publish/courses/student_visa_sponsorship/edit.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
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
Oops, something went wrong.