Sha256: 66b93a950f045d4eaf9c9b40d50a28619aa1ec84d5f4924edc3ff4077a4cf7ca

Contents?: true

Size: 798 Bytes

Versions: 13

Compression:

Stored size: 798 Bytes

Contents

<%
  add_gem_component_stylesheet("inset-text")

  id ||= "inset-text-#{SecureRandom.hex(4)}"
  margin_top ||= 6
  margin_bottom ||= 6

  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new({
    margin_top: margin_top,
    margin_bottom: margin_bottom
  })

  component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
  component_helper.add_class("gem-c-inset-text govuk-inset-text gem-c-force-print-link-styles-within")
  component_helper.add_class(shared_helper.get_margin_top)
  component_helper.add_class(shared_helper.get_margin_bottom)
  component_helper.set_id(id)
%>
<%= tag.div(**component_helper.all_attributes) do %>
  <% if defined? text %>
    <%= text %>
  <% elsif block_given? %>
    <%= yield %>
  <% end %>
<% end %>

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
govuk_publishing_components-46.3.1 app/views/govuk_publishing_components/components/_inset_text.html.erb
govuk_publishing_components-46.3.0 app/views/govuk_publishing_components/components/_inset_text.html.erb
govuk_publishing_components-46.2.0 app/views/govuk_publishing_components/components/_inset_text.html.erb
govuk_publishing_components-46.1.0 app/views/govuk_publishing_components/components/_inset_text.html.erb
govuk_publishing_components-46.0.0 app/views/govuk_publishing_components/components/_inset_text.html.erb
govuk_publishing_components-45.10.0 app/views/govuk_publishing_components/components/_inset_text.html.erb
govuk_publishing_components-45.9.0 app/views/govuk_publishing_components/components/_inset_text.html.erb
govuk_publishing_components-45.8.0 app/views/govuk_publishing_components/components/_inset_text.html.erb
govuk_publishing_components-45.7.0 app/views/govuk_publishing_components/components/_inset_text.html.erb
govuk_publishing_components-45.6.1 app/views/govuk_publishing_components/components/_inset_text.html.erb
govuk_publishing_components-45.6.0 app/views/govuk_publishing_components/components/_inset_text.html.erb
govuk_publishing_components-45.5.0 app/views/govuk_publishing_components/components/_inset_text.html.erb
govuk_publishing_components-45.4.1 app/views/govuk_publishing_components/components/_inset_text.html.erb