Sha256: 0fee7713ca6bd737f051e8a2cf5a3ef558e1bb59c79289b827e50b57ce4e31ec

Contents?: true

Size: 864 Bytes

Versions: 313

Compression:

Stored size: 864 Bytes

Contents

<%
  list_limit = 5
  remaining = []
  if items.length > (list_limit + 2)
    remaining = items[list_limit..items.length]
    items = items[0...list_limit]
  end
%>
<% if remaining.any? %>
  <%= items.to_sentence(last_word_connector: ', ').html_safe %>
  <div class="gem-c-metadata__toggle-wrap">
    <a href="#"
       class="gem-c-metadata__definition-link"
       data-controls="toggle-<%= toggle_id %>"
       data-expanded="false"
       data-toggled-text="<%= t("govuk_component.metadata.toggle_less", default: "Show fewer") %>">
        <%= t("govuk_component.metadata.toggle_more", number: remaining.length, default: "+ #{remaining.length} more") %>
    </a>
  </div>
  <span id="toggle-<%= toggle_id %>" class="gem-c-metadata__toggle-items js-hidden"><%= remaining.to_sentence.html_safe %></span>
<% else %>
  <%= items.to_sentence.html_safe %>
<% end %>

Version data entries

313 entries across 313 versions & 1 rubygems

Version Path
govuk_publishing_components-24.10.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-24.9.4 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-24.9.3 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-24.9.2 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-24.9.1 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-24.9.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-24.8.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-24.7.1 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-24.7.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-24.6.1 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-24.6.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-24.5.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-24.4.1 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-24.4.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-24.3.1 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-24.3.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-24.2.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-24.1.1 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-24.1.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-24.0.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb