Sha256: a412efc189f74f33e267b55d675acdc1e8d5c9f3e41e76e38545a5aee341d7e8

Contents?: true

Size: 861 Bytes

Versions: 7

Compression:

Stored size: 861 Bytes

Contents

<%
  extra_spacing ||= nil
  items ||= []
  list_type ||= "unordered"
  visible_counters ||= nil

  component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
  component_helper.add_class("gem-c-list govuk-list")
  component_helper.add_class("govuk-list--bullet") if visible_counters and list_type === "unordered"
  component_helper.add_class("govuk-list--number") if visible_counters and list_type === "number"
  component_helper.add_class("govuk-list--spaced") if extra_spacing

  # Default list type is unordered list.
  list_tag = "ul"

  # Set to ordered list to override default.
  list_tag = "ol" if list_type === "number"
%>
<% if items.any? %>
  <%= content_tag list_tag, **component_helper.all_attributes do %>
    <% items.each do |item| %>
      <li><%= raw(item) %></li>
    <% end %>
  <% end %>
<% end %>

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
govuk_publishing_components-51.1.0 app/views/govuk_publishing_components/components/_list.html.erb
govuk_publishing_components-51.0.0 app/views/govuk_publishing_components/components/_list.html.erb
govuk_publishing_components-50.0.1 app/views/govuk_publishing_components/components/_list.html.erb
govuk_publishing_components-50.0.0 app/views/govuk_publishing_components/components/_list.html.erb
govuk_publishing_components-49.1.0 app/views/govuk_publishing_components/components/_list.html.erb
govuk_publishing_components-49.0.0 app/views/govuk_publishing_components/components/_list.html.erb
govuk_publishing_components-48.0.0 app/views/govuk_publishing_components/components/_list.html.erb