Skip to content

Commit

Permalink
Use list gem component for past role holders
Browse files Browse the repository at this point in the history
Replace the `taxon-list` component with the `list` component from the govuk_publishing_components gem.

`list_type: "number"` has been used to ensure an ordered list is used to match the current HTML structure
  • Loading branch information
MartinJJones committed Nov 27, 2024
1 parent b2408f2 commit 35057dc
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions app/views/roles/_past_role_holders.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
text: t("roles.previous_holders"),
margin_bottom: 2,
} %>
<%= render "components/taxon_list", {
heading_level: 3,
<%= render "govuk_publishing_components/components/list", {
list_type: "number",
items: role.past_holders.map do |rh|
{
text: rh['title'],
path: rh['base_path'],
description: "#{rh['details']['start_year']} to #{rh['details']['end_year']}",
}
sanitize(
"<h3 class='govuk-heading-s govuk-!-margin-bottom-1'>
<a href=#{rh['base_path']} class='govuk-link'>#{rh['title']}</a>
</h3>
<p class='govuk-body'>#{rh['details']['start_year']} to #{rh['details']['end_year']}</p>"
)
end
} %>
</section>
Expand Down

0 comments on commit 35057dc

Please sign in to comment.