% add_gem_component_stylesheet("document-list") items ||= [] classes = "gem-c-document-list" classes << " gem-c-document-list--top-margin" if local_assigns[:margin_top] classes << " gem-c-document-list--bottom-margin" if local_assigns[:margin_bottom] classes << " gem-c-document-list--no-underline" if local_assigns[:remove_underline] classes << " gem-c-document-list--no-top-border" if local_assigns[:remove_top_border] classes << " gem-c-document-list--no-top-border-first-child" if local_assigns[:remove_top_border_from_first_child] within_multitype_list ||= false within_multitype_list_class = " gem-c-document-list__multi-list" if within_multitype_list title_with_context_class = " gem-c-document-list__item-title--context" brand ||= false brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand) %> <% if items.any? %> <% unless within_multitype_list %>
<%= item[:highlight_text] %>
<% end %> <%= item_classes = "gem-c-document-list__item-title #{brand_helper.color_class} #{title_with_context_class if item[:link][:context]}" if item[:link][:path] rel = [ "external", "nofollow", "noopener", "noreferrer", "opener", ].include?(item[:link][:rel]) ? item[:link][:rel] : nil link_to( item[:link][:text], item[:link][:path], data: item[:link][:data_attributes], class: "#{item_classes} govuk-link", lang: item[:link][:locale].presence, rel: rel, ) else content_tag( "span", item[:link][:text], data: item[:link][:data_attributes], class: item_classes, ) end %> <% if item[:link][:context] %> <%= item[:link][:context] %> <% end %> <% if item[:link][:description] %>"><%= item[:link][:description] %>
<% end %> <% if item[:metadata] %> <% end %> <% if item[:subtext] %><%= item[:subtext] %>
<% end %> <% if item[:parts] && item[:parts].any? %><%= part[:link][:description] %>
<% end %>