Skip to content

Commit

Permalink
Improve results - 1/7 - Remove content from the course results and co…
Browse files Browse the repository at this point in the history
…urse summary
  • Loading branch information
gms-gs committed Nov 18, 2024
1 parent b58b4be commit fc54cd3
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 37 deletions.
25 changes: 14 additions & 11 deletions app/components/find/courses/summary_component/view.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@

<%= govuk_summary_list(actions: false) do |summary_list| %>
<% summary_list.with_row do |row| %>
<% row.with_key(text: t(".fee_or_salary")) %>
<% row.with_key(text: t(".course_fee")) %>
<% row.with_value do %>
<%= course.funding %>
<br>
<span class="govuk-hint govuk-!-font-size-16"><%= course.funding_option %></span>
<% end %>
<% end %>

<% unless no_fee? %>
<% summary_list.with_row do |row| %>
<% row.with_key(text: t(".course_fee")) %>
<% row.with_value do %>
<% if course.salaried? %>
This course pays a <strong>salary</strong>.
<% if course.apprenticeship? %>
It is a Teaching Apprenticeship.
<% end %>
<br>
<span class="govuk-hint govuk-!-font-size-16">There is no fee.</span>
<% elsif course.apprenticeship? %>
This is a Teaching Apprenticeship course that pays a <strong>salary</strong>.
<span class="govuk-hint govuk-!-font-size-16">There is no fee.</span>
<% else %>
<%= course.course_fee_content %>
<br>
<span class="govuk-hint govuk-!-font-size-16"><%= course.funding_option %></span>
<% end %>
<% end %>
<% end %>
Expand Down
37 changes: 17 additions & 20 deletions app/components/find/results/search_result_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,23 @@
<% end %>

<% summary_list.with_row do |row| %>
<% row.with_key(text: t(".fee_or_salary")) %>
<% row.with_key(text: t(".course_fee")) %>
<% row.with_value do %>
<%= course.funding %>
<br>
<span class="govuk-hint govuk-!-font-size-16"><%= course.funding_option %></span>
<% end %>
<% end %>

<% unless no_fee? %>
<% summary_list.with_row do |row| %>
<% row.with_key(text: t(".course_fee")) %>
<% row.with_value(text: course.course_fee_content) %>
<% if course.salaried? %>
This course pays a <strong>salary</strong>.
<% if course.apprenticeship? %>
It is a Teaching Apprenticeship.
<% end %>
<br>
<span class="govuk-hint govuk-!-font-size-16">There is no fee.</span>
<% elsif course.apprenticeship? %>
This is a Teaching Apprenticeship course that pays a <strong>salary</strong>.
<span class="govuk-hint govuk-!-font-size-16">There is no fee.</span>
<% else %>
<%= course.course_fee_content %>
<br>
<span class="govuk-hint govuk-!-font-size-16"><%= course.funding_option %></span>
<% end %>
<% end %>
<% end %>

Expand All @@ -48,15 +53,7 @@

<% summary_list.with_row do |row| %>
<% row.with_key(text: t(".qualification")) %>
<% row.with_value do %>
<% if accredited_provider %>
<%= formatted_qualification %>
<br>
<span class="govuk-hint govuk-!-font-size-16"><%= accredited_provider %></span>
<% else %>
<%= formatted_qualification %>
<% end %>
<% end %>
<% row.with_value(text: formatted_qualification) %>
<% end %>

<% summary_list.with_row do |row| %>
Expand Down
6 changes: 0 additions & 6 deletions app/components/find/results/search_result_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ def visa_sponsorship_status
'Visas cannot be sponsored'
end
end

def accredited_provider
return nil if course.accrediting_provider.blank?

"QTS ratified by #{helpers.smart_quotes(course.accrediting_provider.provider_name)}"
end
end
end
end

0 comments on commit fc54cd3

Please sign in to comment.