-
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 #4358 from DFE-Digital/cv/couse-training-with-diss…
…abilities Training with disabilities view on courses
- Loading branch information
Showing
25 changed files
with
396 additions
and
114 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
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
18 changes: 18 additions & 0 deletions
18
app/controllers/find/courses/training_with_disabilities_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,18 @@ | ||
# frozen_string_literal: true | ||
|
||
module Find | ||
module Courses | ||
class TrainingWithDisabilitiesController < Find::ApplicationController | ||
before_action -> { render_not_found if provider.nil? } | ||
before_action -> { render_not_found if provider.train_with_disability.blank? } | ||
|
||
def show | ||
@course = provider.courses.includes( | ||
:enrichments, | ||
subjects: [:financial_incentive], | ||
site_statuses: [:site] | ||
).find_by!(course_code: params[:course_code]&.upcase).decorate | ||
end | ||
end | ||
end | ||
end |
19 changes: 19 additions & 0 deletions
19
app/controllers/publish/courses/training_with_disabilities_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,19 @@ | ||
# frozen_string_literal: true | ||
|
||
module Publish | ||
module Courses | ||
class TrainingWithDisabilitiesController < PublishController | ||
include CourseBasicDetailConcern | ||
before_action :build_course, only: %i[show] | ||
|
||
def show; end | ||
|
||
private | ||
|
||
def build_course | ||
super | ||
authorize @course | ||
end | ||
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
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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
<div class="govuk-!-margin-bottom-8"> | ||
<h2 class="govuk-heading-l" id="section-train-with-disabilities">Training with disabilities and other needs</h2> | ||
<div data-qa="course__train_with_disabilities"> | ||
<% if course.provider.train_with_disability.present? %> | ||
<%= markdown(course.provider.train_with_disability) %> | ||
<% else %> | ||
<%= render CoursePreview::MissingInformationComponent.new(course:, information_type: :train_with_disability, is_preview: preview?(params)) %> | ||
<% end %> | ||
</div> | ||
<h1 class="govuk-heading-xl" id="section-train-with-disabilities"> | ||
<%= t(".heading", provider_name: course.provider_name) %> | ||
</h1> | ||
|
||
<div data-qa="course__train_with_disabilities"> | ||
<% if course.provider.train_with_disability.present? %> | ||
<%= markdown(course.provider.train_with_disability) %> | ||
<% else %> | ||
<%= render CoursePreview::MissingInformationComponent.new(course:, information_type: :train_with_disability, is_preview: preview?(params)) %> | ||
<% end %> | ||
</div> |
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
29 changes: 29 additions & 0 deletions
29
app/views/find/courses/training_with_disabilities/show.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,29 @@ | ||
<%= content_for :page_title do %> | ||
<%= t(".heading", provider_name: @course.provider_name) %> | ||
<% end %> | ||
<% content_for :before_content do %> | ||
<%= govuk_back_link( | ||
href: search_ui_course_page_url( | ||
provider_code: @course.provider_code, | ||
course_code: @course.course_code | ||
), | ||
text: t( | ||
".back", | ||
course_name: @course.name, | ||
course_code: @course.course_code | ||
) | ||
) %> | ||
<% end %> | ||
|
||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<%= render partial: "find/courses/train_with_disabilities", locals: { course: @course } %> | ||
|
||
<p class="govuk-body"> | ||
<%= govuk_link_to( | ||
t(".contact", provider_name: @course.provider_name), | ||
find_provider_path(@course.provider_code, @course.course_code) | ||
) %> | ||
</p> | ||
</div> | ||
</div> |
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/views/publish/courses/training_with_disabilities/show.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,34 @@ | ||
<%= content_for :page_title do %> | ||
<%= t(".heading", provider_name: @course.provider_name) %> | ||
<% end %> | ||
<% content_for :before_content do %> | ||
<%= govuk_back_link( | ||
href: preview_publish_provider_recruitment_cycle_course_path( | ||
@course.provider_code, | ||
@course.recruitment_cycle_year, | ||
@course.course_code | ||
), | ||
text: t( | ||
".back", | ||
course_name: @course.name, | ||
course_code: @course.course_code | ||
) | ||
) %> | ||
<% end %> | ||
|
||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<%= render partial: "find/courses/train_with_disabilities", locals: { course: } %> | ||
|
||
<p class="govuk-body"> | ||
<%= govuk_link_to( | ||
t(".contact", provider_name: @course.provider_name), | ||
provider_publish_provider_recruitment_cycle_course_path( | ||
@course.provider_code, | ||
@course.recruitment_cycle_year, | ||
@course.course_code | ||
) | ||
) %> | ||
</p> | ||
</div> | ||
</div> |
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.