<% add_gem_component_stylesheet("document-list") local_assigns[:margin_bottom] ||= 5 items ||= [] component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns) component_helper.add_class("gem-c-document-list") component_helper.add_class("gem-c-document-list--no-top-border") if local_assigns[:remove_top_border] component_helper.add_class("gem-c-document-list--no-top-border-first-child") if local_assigns[:remove_top_border_from_first_child] component_helper.add_class("gem-c-document-list--equal-item-spacing") if local_assigns[:equal_item_spacing] extra_link_classes = "govuk-link--no-underline" if local_assigns[:remove_underline] title_with_context_class = " gem-c-document-list__item-title--context" brand ||= false brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand) disable_ga4 ||= false unless disable_ga4 ga4_extra_data ||= {} component_helper.add_data_attribute({ module: "ga4-link-tracker", ga4_track_links_only: "", ga4_link: { "event_name": "navigation", "type": "document list", }.merge(ga4_extra_data) }) end %> <% if items.any? %> <%= tag.ul(**component_helper.all_attributes) do %> <% items.each do |item| %> <% highlight_class = " gem-c-document-list__item--highlight" if item[:highlight] %>
  • <% if item[:highlight] && item[:highlight_text] %>

    <%= item[:highlight_text] %>

    <% end %> <%= content_tag :div, class: "gem-c-document-list__item-title" do -%> <%= item_classes = "#{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 gem-c-force-print-link-styles #{extra_link_classes}", lang: item[:link][:locale].presence, rel: rel, ) else content_tag( "span", item[:link][:text], data: item[:link][:data_attributes], class: item_classes, ) end %> <% 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? %> <% end %>
  • <% end %> <% end %> <% end %>