Sha256: 0a934e5b137598f855c2f3bc4a1460503e99e2c288efb6a5a641a6e62c4ba077

Contents?: true

Size: 1.88 KB

Versions: 188

Compression:

Stored size: 1.88 KB

Contents

<%
  brand ||= false
  brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
  card_helper = GovukPublishingComponents::Presenters::ImageCardHelper.new(local_assigns)
  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
%>
<% if card_helper.href || card_helper.extra_links.any? %>
  <div class="gem-c-image-card <%= "gem-c-image-card--large" if card_helper.large %> <%= brand_helper.brand_class %>"
    <%= "data-module=track-click" if card_helper.is_tracking? %>
  >
    <%= card_helper.image %>

    <div class="gem-c-image-card__text-wrapper">
      <%= card_helper.context %>

      <% if card_helper.heading_text %>
        <%= content_tag(shared_helper.get_heading_level,
          class: "gem-c-image-card__title") do %>
            <% if card_helper.href %>
              <%= link_to card_helper.heading_text, card_helper.href,
                class: "gem-c-image-card__title-link #{brand_helper.color_class}",
                data: card_helper.href_data_attributes
              %>
            <% else %>
              <%= card_helper.heading_text %>
            <% end %>
        <% end %>
      <% end %>

      <%= card_helper.description %>

      <% if card_helper.extra_links.any? %>
        <ul class="gem-c-image-card__list <%= "gem-c-image-card__list--indented" if not card_helper.extra_links_no_indent %>">
          <% card_helper.extra_links.each do |link| %>
            <li class="gem-c-image-card__list-item">
              <%= link_to link[:text], link[:href],
                class: "gem-c-image-card__list-item-link #{brand_helper.color_class}",
                data: link[:data_attributes]
              %>
            </li>
          <% end %>
        </ul>
      <% end %>

      <% if card_helper.metadata %>
        <p class="gem-c-image-card__metadata"><%= card_helper.metadata %></p>
      <% end %>
    </div>
  </div>
<% end %>

Version data entries

188 entries across 188 versions & 1 rubygems

Version Path
govuk_publishing_components-21.60.1 app/views/govuk_publishing_components/components/_image_card.html.erb
govuk_publishing_components-21.60.0 app/views/govuk_publishing_components/components/_image_card.html.erb
govuk_publishing_components-21.59.0 app/views/govuk_publishing_components/components/_image_card.html.erb
govuk_publishing_components-21.58.0 app/views/govuk_publishing_components/components/_image_card.html.erb
govuk_publishing_components-21.57.1 app/views/govuk_publishing_components/components/_image_card.html.erb
govuk_publishing_components-21.57.0 app/views/govuk_publishing_components/components/_image_card.html.erb
govuk_publishing_components-21.56.2 app/views/govuk_publishing_components/components/_image_card.html.erb
govuk_publishing_components-21.56.1 app/views/govuk_publishing_components/components/_image_card.html.erb
govuk_publishing_components-21.56.0 app/views/govuk_publishing_components/components/_image_card.html.erb
govuk_publishing_components-21.55.4 app/views/govuk_publishing_components/components/_image_card.html.erb
govuk_publishing_components-21.55.3 app/views/govuk_publishing_components/components/_image_card.html.erb
govuk_publishing_components-21.55.2 app/views/govuk_publishing_components/components/_image_card.html.erb
govuk_publishing_components-21.55.1 app/views/govuk_publishing_components/components/_image_card.html.erb
govuk_publishing_components-21.55.0 app/views/govuk_publishing_components/components/_image_card.html.erb
govuk_publishing_components-21.54.0 app/views/govuk_publishing_components/components/_image_card.html.erb
govuk_publishing_components-21.53.0 app/views/govuk_publishing_components/components/_image_card.html.erb
govuk_publishing_components-21.52.1 app/views/govuk_publishing_components/components/_image_card.html.erb
govuk_publishing_components-21.52.0 app/views/govuk_publishing_components/components/_image_card.html.erb
govuk_publishing_components-21.51.0 app/views/govuk_publishing_components/components/_image_card.html.erb
govuk_publishing_components-21.50.1 app/views/govuk_publishing_components/components/_image_card.html.erb