Sha256: 9437eb67a8bea9ad26d3ed8a90d7051a675851e6e49163dcfb11e5b87e6f8d44

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

<%
  average_title_length ||= false
  context ||= false
  context_locale ||= false
  context_text = context.is_a?(Hash) ? context[:text] : context
  context_href = context.is_a?(Hash) ? context[:href] : false
  context_data = context.is_a?(Hash) ? context[:data] : false

  inverse ||= false
  local_assigns[:margin_top] ||= 8
  local_assigns[:margin_bottom] ||= 8

  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)

  classes = %w(gem-c-title)
  classes << "gem-c-title--inverse" if inverse
  classes << (shared_helper.get_margin_top)
  classes << (shared_helper.get_margin_bottom)
%>
<%= content_tag(:div, class: classes) do %>
  <% if context %>
    <span class="govuk-caption-xl" <%= "lang=#{context_locale}" if context_locale.present? %>>
      <%= context_href ? link_to(context_text, context_href, class: 'gem-c-title__context-link govuk-link', data: context_data) : context_text %>
    </span>
  <% end %>
  <h1 class="gem-c-title__text <% if average_title_length %>gem-c-title__text--<%= average_title_length %><% end %>">
    <%= title %>
  </h1>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
govuk_publishing_components-21.41.3 app/views/govuk_publishing_components/components/_title.html.erb