Skip to content

Commit

Permalink
Replace taxon-list with document-list gem component
Browse files Browse the repository at this point in the history
- Use the `document-list` component from the gem instead of the `taxon-list` app component in the `tagged_content_list.html.erb` and `accordion.html.erb` view templates
- By using the document-list component, the list will change from an ordered list to an unordered list, this feels like a slight improvement as the content presented does not appear to be in order of sequence/importance
- `heading_level` variable removed from the `tagged_content_list.html.erb` template, the document-list component does not support headings and is not required here

This approach is also consistent with other places the document-list component is used, for example:

- [Education, training and skills - GOV.UK](https://www.gov.uk/education)  (collections)
- [Find contact details for services - GOV.UK](https://www.gov.uk/contact)  (feedback)
- [Travel or do business in Europe: Brexit guidance](https://www.gov.uk/government/collections/brexit-guidance) (government-frontend)
  • Loading branch information
MartinJJones committed Nov 27, 2024
1 parent a66d51f commit de8930b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions app/views/world_wide_taxons/_tagged_content_list.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<% if presented_taxon.tagged_content.any? %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<% heading_level = heading_level ? heading_level : false %>
<%= render 'components/taxon_list', {
heading_level: heading_level,
items: taxon_list_params(presented_taxon)
<%= render "govuk_publishing_components/components/document_list", {
remove_top_border: true,
items: taxon_list_params(presented_taxon)
} %>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions app/views/world_wide_taxons/accordion.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
%>
<% presented_taxon.accordion_content.each_with_index do |taxon, index| %>
<% contents = capture do %>
<%= render 'components/taxon_list', {
heading_level: 3,
items: taxon_list_params(taxon)
} %>
<%= render "govuk_publishing_components/components/document_list", {
remove_top_border: true,
items: taxon_list_params(taxon)
} %>
<% end %>
<%
id = taxon.base_path || taxon.title.downcase.tr(" ","-")
Expand Down

0 comments on commit de8930b

Please sign in to comment.