-
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.
Add provider & accrediting_provider views course
The course show page for find and publish(preview page) has too much content. This commit tries to reduce this content by putting the provider of the course and the accrediting provider of the course into their own views. For this to happen we also needed to change the logic of the redirects/back links when adding a provider through the course show page. You can do this when you have a draft course but without a provider.
- Loading branch information
1 parent
92943e4
commit f9f4959
Showing
37 changed files
with
638 additions
and
245 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
4 changes: 3 additions & 1 deletion
4
app/components/find/courses/contact_details_component/view.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
110 changes: 54 additions & 56 deletions
110
app/components/find/courses/qualifications_summary_component/view.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 |
---|---|---|
@@ -1,58 +1,56 @@ | ||
<dd data-qa="course__qualifications"> | ||
<% case find_outcome %> | ||
<% when "QTS" %> | ||
<%= govuk_details(summary_text: "QTS") do %> | ||
<p class="govuk-body"> | ||
Qualified teacher status (QTS) allows you to teach in state schools in England and may also allow you to teach in other parts of the UK. | ||
</p> | ||
<p class="govuk-body"> | ||
It may also allow you to teach overseas, though you should always check what qualifications are needed in the country you’d like to teach in. | ||
</p> | ||
<% end %> | ||
<% case find_outcome %> | ||
<% when "QTS" %> | ||
<%= govuk_details(summary_text: "QTS") do %> | ||
<p class="govuk-body"> | ||
Qualified teacher status (QTS) allows you to teach in state schools in England and may also allow you to teach in other parts of the UK. | ||
</p> | ||
<p class="govuk-body"> | ||
It may also allow you to teach overseas, though you should always check what qualifications are needed in the country you’d like to teach in. | ||
</p> | ||
<% end %> | ||
<% when "QTS with PGCE" %> | ||
<%= govuk_details(summary_text: "QTS with PGCE") do %> | ||
<p class="govuk-body"> | ||
You need qualified teacher status (QTS) to teach in state schools in England. QTS may also allow you to teach in other parts of the UK. | ||
</p> | ||
<p class="govuk-body"> | ||
This course also offers a postgraduate certificate in education (PGCE). PGCE courses can include credits that count towards a master’s degree. | ||
</p> | ||
<% end %> | ||
<% when "PGDE with QTS" %> | ||
<%= govuk_details(summary_text: "PGDE with QTS") do %> | ||
<p class="govuk-body"> | ||
A postgraduate diploma in education (PGDE) with qualified teacher status (QTS) will allow you to teach in state schools in England and may allow you to teach in other parts of the UK. | ||
</p> | ||
<p class="govuk-body"> | ||
It may also allow you to teach overseas, though you should always check what qualifications are needed in the country you’d like to teach in. | ||
</p> | ||
<p class="govuk-body"> | ||
Many PGDE courses include credits towards a Master’s degree. | ||
</p> | ||
<% end %> | ||
<% when "PGCE" %> | ||
<%= govuk_details(summary_text: "PGCE") do %> | ||
<p class="govuk-body"> | ||
A postgraduate certificate in education (PGCE) is an academic qualification in education. | ||
</p> | ||
<p class="govuk-body"> | ||
It’s recognised internationally, though you should always check what qualifications are needed in the country you’d like to teach in. | ||
</p> | ||
<p class="govuk-body"> | ||
This course does not lead to qualified teacher status (QTS). | ||
</p> | ||
<% end %> | ||
<% when "PGDE" %> | ||
<%= govuk_details(summary_text: "PGDE") do %> | ||
<p class="govuk-body"> | ||
A postgraduate diploma in education (PGDE) is equivalent to a postgraduate certificate in education (PGCE). | ||
</p> | ||
<p class="govuk-body"> | ||
It’s recognised internationally, though you should always check what qualifications are needed in the country you’d like to teach in. | ||
</p> | ||
<p class="govuk-body"> | ||
This course does not lead to qualified teacher status (QTS). | ||
</p> | ||
<% end %> | ||
<%= govuk_details(summary_text: "QTS with PGCE") do %> | ||
<p class="govuk-body"> | ||
You need qualified teacher status (QTS) to teach in state schools in England. QTS may also allow you to teach in other parts of the UK. | ||
</p> | ||
<p class="govuk-body"> | ||
This course also offers a postgraduate certificate in education (PGCE). PGCE courses can include credits that count towards a master’s degree. | ||
</p> | ||
<% end %> | ||
<% when "PGDE with QTS" %> | ||
<%= govuk_details(summary_text: "PGDE with QTS") do %> | ||
<p class="govuk-body"> | ||
A postgraduate diploma in education (PGDE) with qualified teacher status (QTS) will allow you to teach in state schools in England and may allow you to teach in other parts of the UK. | ||
</p> | ||
<p class="govuk-body"> | ||
It may also allow you to teach overseas, though you should always check what qualifications are needed in the country you’d like to teach in. | ||
</p> | ||
<p class="govuk-body"> | ||
Many PGDE courses include credits towards a Master’s degree. | ||
</p> | ||
<% end %> | ||
<% when "PGCE" %> | ||
<%= govuk_details(summary_text: "PGCE") do %> | ||
<p class="govuk-body"> | ||
A postgraduate certificate in education (PGCE) is an academic qualification in education. | ||
</p> | ||
<p class="govuk-body"> | ||
It’s recognised internationally, though you should always check what qualifications are needed in the country you’d like to teach in. | ||
</p> | ||
<p class="govuk-body"> | ||
This course does not lead to qualified teacher status (QTS). | ||
</p> | ||
<% end %> | ||
<% when "PGDE" %> | ||
<%= govuk_details(summary_text: "PGDE") do %> | ||
<p class="govuk-body"> | ||
A postgraduate diploma in education (PGDE) is equivalent to a postgraduate certificate in education (PGCE). | ||
</p> | ||
<p class="govuk-body"> | ||
It’s recognised internationally, though you should always check what qualifications are needed in the country you’d like to teach in. | ||
</p> | ||
<p class="govuk-body"> | ||
This course does not lead to qualified teacher status (QTS). | ||
</p> | ||
<% end %> | ||
</dd> | ||
<% end %> |
86 changes: 54 additions & 32 deletions
86
app/components/find/courses/summary_component/view.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 |
---|---|---|
@@ -1,49 +1,71 @@ | ||
<dl class="app-description-list govuk-!-margin-bottom-8"> | ||
<% if accrediting_provider.present? && (accrediting_provider.provider_code != provider.provider_code) %> | ||
<dt class="app-description-list__label">Accredited provider</dt> | ||
<dd data-qa="course__accredited_provider"><%= accrediting_provider.provider_name %></dd> | ||
<% end %> | ||
<dt class="app-description-list__label">Fee or salary</dt> | ||
<dd data-qa="course__funding_option"><%= course.funding %> | ||
<%= govuk_summary_list(actions: false, classes: ['govuk-summary-list--no-border']) do |summary_list| %>i | ||
<% summary_list.with_row do |row| %> | ||
<% row.with_key(text: t(".fee_or_salary")) %> | ||
<% row.with_value do %> | ||
<%= course.funding %> | ||
<br> | ||
<p class="govuk-hint"><%= course.funding_option %> | ||
</dd> | ||
</dt> | ||
|
||
<dt class="app-description-list__label">Visa sponsorship</dt> | ||
<dd data-qa="course__visa_sponsorship"><%= visa_sponsorship_row %></dd> | ||
<p class="govuk-hint"><%= course.funding_option %></p> | ||
<% end %> | ||
<% end %> | ||
|
||
<% unless no_fee? %> | ||
<dt class="app-description-list__label">Course fee</dt> | ||
<dd data-qa="course__fee"><%= course_fee_value %></dd> | ||
<% summary_list.with_row do |row| %> | ||
<% row.with_key(text: t(".course_fee"))%> | ||
<% row.with_value(text: course_fee_value) %> | ||
<% end %> | ||
<% end %> | ||
|
||
<% if length.present? %> | ||
<% summary_list.with_row do |row| %> | ||
<% row.with_key(text: t(".course_length")) %> | ||
<% row.with_value(text: course_length_with_study_mode_row) %> | ||
<% end %> | ||
<% end %> | ||
|
||
<dt class="app-description-list__label">Qualification</dt> | ||
<%= render Find::Courses::QualificationsSummaryComponent::View.new(find_outcome) %> | ||
<% if age_range_in_years.present? %> | ||
<dt class="app-description-list__label">Age range</dt> | ||
<dd data-qa="course__age_range"><%= age_range_in_years_row %></dd> | ||
<% summary_list.with_row do |row| %> | ||
<% row.with_key(text: t(".age_range")) %> | ||
<% row.with_value(text: age_range_in_years_row) %> | ||
<% end %> | ||
<% end %> | ||
|
||
<% if length.present? %> | ||
<dt class="app-description-list__label">Course length</dt> | ||
<dd data-qa="course__length"><%= course_length_with_study_mode_row %></dd> | ||
<% summary_list.with_row do |row| %> | ||
<% row.with_key(text: t(".qualification")) %> | ||
<% row.with_value do %> | ||
<%= render Find::Courses::QualificationsSummaryComponent::View.new(find_outcome) %> | ||
<% end %> | ||
<% end %> | ||
|
||
<% summary_list.with_row do |row| %> | ||
<% row.with_key(text: t(".provider")) %> | ||
<% row.with_value do %> | ||
<%= govuk_link_to course.provider_name, x_provider_url %> | ||
<% end %> | ||
<% end %> | ||
|
||
<% summary_list.with_row do |row| %> | ||
<% row.with_key(text: t(".accredited_by")) %> | ||
<% row.with_value do %> | ||
<%= govuk_link_to course.accrediting_provider.provider_name, x_accrediting_provider_url %> | ||
<% end %> | ||
<% end %> | ||
|
||
<% if show_apply_from_row? %> | ||
<dt class="app-description-list__label">Date you can apply from</dt> | ||
<dd data-qa="course__applications_open"><%= l(applications_open_from&.to_date) %></dd> | ||
<% summary_list.with_row do |row| %> | ||
<% row.with_key(text: t(".date_can_apply")) %> | ||
<% row.with_value(text: l(applications_open_from&.to_date)) %> | ||
<% end %> | ||
<% end %> | ||
|
||
<% if start_date.present? %> | ||
<dt class="app-description-list__label">Date course starts</dt> | ||
<dd data-qa="course__start_date"><%= l(start_date&.to_date, format: :short) %></dd> | ||
<% summary_list.with_row do |row| %> | ||
<% row.with_key(text: t(".date_course_start")) %> | ||
<% row.with_value(text: l(start_date&.to_date, format: :short)) %> | ||
<% end %> | ||
<% end %> | ||
|
||
<% if provider.decorate.website.present? %> | ||
<dt class="app-description-list__label">Website</dt> | ||
<dd data-qa="course__provider_website"> | ||
<%= govuk_link_to provider.decorate.website, provider.decorate.website %> | ||
</dd> | ||
<% summary_list.with_row do |row| %> | ||
<% row.with_key(text: t(".visa_sponsorship")) %> | ||
<% row.with_value(text: visa_sponsorship_row) %> | ||
<% end %> | ||
</dl> | ||
<% 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
17 changes: 17 additions & 0 deletions
17
app/controllers/find/courses/accrediting_providers_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,17 @@ | ||
# frozen_string_literal: true | ||
|
||
module Find | ||
module Courses | ||
class AccreditingProvidersController < Find::ApplicationController | ||
def show | ||
@course = provider.courses.includes( | ||
:enrichments, | ||
subjects: [:financial_incentive], | ||
site_statuses: [:site] | ||
).find_by!(course_code: params[:course_code]&.upcase).decorate | ||
|
||
render_not_found if @course.accrediting_provider.blank? || !@course.is_published? | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# frozen_string_literal: true | ||
|
||
module Find | ||
module Courses | ||
class ProvidersController < Find::ApplicationController | ||
before_action -> { render_not_found if provider.nil? } | ||
|
||
def show | ||
@course = provider.courses.includes( | ||
:enrichments, | ||
subjects: [:financial_incentive], | ||
site_statuses: [:site] | ||
).find_by!(course_code: params[:course_code]&.upcase).decorate | ||
|
||
render_not_found unless @course.is_published? | ||
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
Oops, something went wrong.