-
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.
[2288] Improve Locations (1/6) Add Training Location Information to c…
…ourse Page (#4522) * [2288] Update school placements h1 * [2288] Remove school placements info * [2288] Add intro paragraph below the callout box Different content depending on whether the course is salaried or not * [2288] Update contents * [2288] Add placement schools/study sites description details * [2288] Refactor to use the pluralize method * [2288] Refactor to use govuk component * [2288] Differentiate fee and salary location text * [2288] Add both salaried and fee previews --------- Co-authored-by: Iain McNulty <[email protected]>
- Loading branch information
1 parent
5e701ba
commit 2e8eb75
Showing
11 changed files
with
362 additions
and
85 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
26 changes: 26 additions & 0 deletions
26
app/components/find/courses/training_locations/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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<%= govuk_summary_list(actions: false) do |summary_list| %> | ||
<%= summary_list.with_row do |row| %> | ||
<%= row.with_key { top_heading } %> | ||
<%= row.with_value do %> | ||
<p class="govuk-body"><%= potential_placements_text %></p> | ||
<%= govuk_link_to(t("view_list_of_school_placements"), placements_url) %> | ||
<p class="govuk-hint govuk-!-font-size-16">Locations can change and are not guaranteed</p> | ||
<% end %> | ||
<% end %> | ||
<%= summary_list.with_row do |row| %> | ||
<%= row.with_key { bottom_heading } %> | ||
<%= row.with_value do %> | ||
<p class="govuk-body"><%= potential_study_sites_text %></p> | ||
<ul class="govuk-list govuk-list--spaced"> | ||
<% course.study_sites.each do |study_site| %> | ||
<li> | ||
<p class="govuk-hint govuk-!-font-size-16"> | ||
<strong><%= smart_quotes(study_site.location_name) %></strong><br> | ||
<%= smart_quotes(study_site.decorate.full_address) %> | ||
</p> | ||
</li> | ||
<% end %> | ||
</ul> | ||
<% 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,58 @@ | ||
# frozen_string_literal: true | ||
|
||
module Find | ||
module Courses | ||
module TrainingLocations | ||
class View < ViewComponent::Base | ||
include PublishHelper | ||
include PreviewHelper | ||
|
||
attr_reader :course, :preview | ||
|
||
def initialize(course:, preview: false) | ||
@course = course | ||
@preview = preview | ||
super | ||
end | ||
|
||
def placements_url | ||
if preview | ||
placements_publish_provider_recruitment_cycle_course_path( | ||
course.provider_code, | ||
course.recruitment_cycle_year, | ||
course.course_code | ||
) | ||
else | ||
find_placements_path(course.provider_code, course.course_code) | ||
end | ||
end | ||
|
||
def potential_placements_text | ||
if course.fee_based? | ||
pluralize(course.sites.size, 'potential placement location') | ||
else | ||
pluralize(course.sites.size, 'potential employing school') | ||
end | ||
end | ||
|
||
def potential_study_sites_text | ||
return 'Not listed yet' if course.study_sites.none? | ||
|
||
if course.study_sites.one? | ||
'1 study site' | ||
else | ||
"#{course.study_sites.size} potential study sites" | ||
end | ||
end | ||
|
||
def top_heading | ||
course.fee_based? ? 'Placement schools' : 'Employing schools' | ||
end | ||
|
||
def bottom_heading | ||
'Where you will study' | ||
end | ||
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,2 @@ | ||
en: | ||
view_list_of_school_placements: View list of school placements |
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
Oops, something went wrong.