<% 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) classes = "gem-c-image-card" classes << " gem-c-image-card--large" if card_helper.large classes << " gem-c-image-card--no-image" unless defined?(image_src) font_size ||= card_helper.large ? 'm' : 's' heading_class = %w[gem-c-image-card__title] heading_class << shared_helper.get_heading_size(font_size, 's') heading_link_classes = %w[ gem-c-image-card__title-link govuk-link ] heading_link_classes << brand_helper.color_class extra_link_classes = %w[ gem-c-image-card__list-item-link govuk-link ] extra_link_classes << brand_helper.color_class %> <% if card_helper.href || card_helper.extra_links.any? %>
<%= "lang=#{card_helper.lang}" if card_helper.lang %>>
<% if card_helper.heading_text %> <%= content_tag(shared_helper.get_heading_level, class: heading_class) do %> <% if card_helper.href %> <%= link_to card_helper.heading_text, card_helper.href, class: heading_link_classes, data: card_helper.href_data_attributes %> <% else %> <%= card_helper.heading_text %> <% end %> <% end %> <% end %> <%= card_helper.context %>
<%= card_helper.description %> <% if card_helper.extra_links.any? %> <% end %> <% if card_helper.metadata %> <% end %>
<%= card_helper.image %>
<% end %>