Skip to content

Commit

Permalink
DRY display of qualification in views
Browse files Browse the repository at this point in the history
  • Loading branch information
starswan committed Dec 20, 2024
1 parent d0ca54e commit c869ebd
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def qualification_params
(params[qualification_form_param_key(@category)] || params).permit(:category)
when "create", "edit", "update"
params.require(qualification_form_param_key(@category))
.permit(:category, :finished_studying, :finished_studying_details, :grade, :institution, :name, :subject, :year, qualification_results_attributes: %i[id subject grade])
.permit(:category, :finished_studying, :finished_studying_details, :grade, :institution, :name, :subject, :year, qualification_results_attributes: %i[id subject grade awarding_body])
end
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
p class="govuk-!-margin-bottom-1"
= qualification.qualification_results.map { |result| "#{result.subject} (#{result.grade.upcase})" }.join(", ")
= qualification.qualification_results.map { |result| display_secondary_qualification(result) }.join(", ")

p.govuk-caption-m
- if qualification.display_attributes.include?("institution")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
- row.with_value text: qualification.year
- summary_list.with_row do |row|
- row.with_key text: t("jobseekers.qualifications.subjects_and_grades")
- row.with_value text: safe_join(qualification.qualification_results.map { |res| tag.div("#{res.subject} – #{res.grade}", class: "govuk-body govuk-!-margin-bottom-1") })
- row.with_value text: safe_join(qualification.qualification_results.map { |res| tag.div(display_secondary_qualification(res), class: "govuk-body govuk-!-margin-bottom-1") })
- else
- summary_list.with_row do |row|
- row.with_key text: "Type"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- if qualification.secondary?
- summary_list.with_row do |row|
- row.with_key text: t("jobseekers.profiles.qualifications.subjects_and_grades")
- row.with_value text: safe_join(qualification.qualification_results.map { |res| tag.div("#{res.subject} – #{res.grade}", class: "govuk-body govuk-!-margin-bottom-1") })
- row.with_value text: safe_join(qualification.qualification_results.map { |res| tag.div(display_secondary_qualification(res), class: "govuk-body govuk-!-margin-bottom-1") })

- qualification.display_attributes.each do |attribute|
- summary_list.with_row do |row|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
p class="govuk-!-margin-bottom-1"
= qualification.qualification_results.map { |result| "#{result.subject} (#{result.grade.upcase})" }.join(", ")
= qualification.qualification_results.map { |result| display_secondary_qualification(result) }.join(", ")

p.govuk-caption-m
- if qualification.display_attributes.include?("institution")
Expand Down

0 comments on commit c869ebd

Please sign in to comment.