Sha256: 5ed65b7ca1eb813c818a4a1068350b27c6116939491458335a50d25ea79ac8ca

Contents?: true

Size: 846 Bytes

Versions: 137

Compression:

Stored size: 846 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 govuk-!-display-none-print">
    <a href="#"
       class="gem-c-metadata__definition-link govuk-!-display-none-print"
       data-controls="toggle-<%= toggle_id %>"
       data-expanded="false"
       data-toggled-text="<%= t("components.metadata.toggle_less") %>">
        <%= t("components.metadata.toggle_more", number: remaining.length) %>
    </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

137 entries across 137 versions & 1 rubygems

Version Path
govuk_publishing_components-27.10.2 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-27.10.1 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-27.10.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-27.9.2 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-27.9.1 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-27.9.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-27.8.2 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-27.8.1 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-27.8.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-27.7.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-27.6.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-27.5.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-27.4.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-27.3.1 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-27.3.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-27.2.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-27.1.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-27.0.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-26.0.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
govuk_publishing_components-25.7.0 app/views/govuk_publishing_components/components/metadata/_sentence.html.erb