Sha256: 35c96f855bda49bb6b8b2e59028628021612bd78ade95336fdf3fcf56cda92a0

Contents?: true

Size: 1.87 KB

Versions: 65

Compression:

Stored size: 1.87 KB

Contents

<%
  items ||= []
  inverse ||= false
  half_width ||= false
  within_multitype_list ||= false
  half_width_class = "gem-c-highlight-boxes__item-wrapper--half-width" if half_width
  inverse_class = "gem-c-highlight-boxes--inverse" if inverse
  highlight_boxes_helper = GovukPublishingComponents::Presenters::HighlightBoxesHelper.new(local_assigns)
%>
<% if items.any? %>
  <% unless within_multitype_list %>
    <ol class="gem-c-highlight-boxes" <%= "data-module=gem-track-click" if highlight_boxes_helper.data_tracking? %>>
  <% end %>
    <% items.each do |content_item| %>
      <li class="gem-c-highlight-boxes__item-wrapper <%= half_width_class %>">
        <div class="gem-c-highlight-boxes__item <%= inverse_class %>">
          <%= link_to(
            content_item[:link].fetch(:text),
            content_item[:link].fetch(:path),
            class: "govuk-link gem-c-highlight-boxes__title #{"gem-c-highlight-boxes__title--featured" if content_item[:link][:featured]}",
            data: content_item[:link][:data_attributes]
            )
          %>

          <% if content_item[:link][:description] %>
            <p class="gem-c-highlight-boxes__description"><%= content_item[:link][:description] %></p>
          <% end %>

          <% if content_item[:metadata] %>
            <% content_item[:metadata].each do |metadata_key, metadata_value| %>
              <% if metadata_key.to_s.eql?("public_updated_at") %>
                <time class="gem-c-highlight-boxes__metadata" datetime="<%= metadata_value.iso8601 %>">
                  <%= l(metadata_value, format: '%e %B %Y') %>
                </time>
              <% else %>
                <p class="gem-c-highlight-boxes__metadata"><%= metadata_value %></p>
              <% end %>
            <% end %>
          <% end %>
        </div>
      </li>
    <% end %>
  <% unless within_multitype_list %>
    </ol>
  <% end %>
<% end %>

Version data entries

65 entries across 65 versions & 1 rubygems

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