Sha256: a1b724198550074c138725adc16bf0d6f8b4826aa16e6b2dc0ac53d3cb5ca748

Contents?: true

Size: 1.22 KB

Versions: 35

Compression:

Stored size: 1.22 KB

Contents

<%
  add_gem_component_stylesheet("govspeak")
  inverse ||= false
  direction_class = "direction-#{direction}" if local_assigns.include?(:direction)
  disable_youtube_expansions = local_assigns.fetch(:disable_youtube_expansions) if local_assigns.include?(:disable_youtube_expansions)

  classes = []
  classes << direction_class if direction_class
  classes << "disable-youtube" if disable_youtube_expansions
  classes << "gem-c-govspeak--inverse" if inverse
%>

<div class="gem-c-govspeak govuk-govspeak <%= classes.join(" ") %>" data-module="govspeak">
  <% if local_assigns.include?(:content) %>
    <% if content.html_safe? %>
      <%= content %>
    <% else %>
      <% raise "
        You've passed in unsanitised HTML into the Govspeak component as the
        `content` parameter.

        To fix this use a `do` block with the sanitize method - see
        https://components.publishing.service.gov.uk/component-guide/govspeak/
        for the updated documentation and
        https://github.com/alphagov/govuk_publishing_components/pull/1632/
        for further examples.

        Called from #{caller_locations.find { |l| l.to_s.include?('.erb') }}
        " %>
    <% end %>
  <% elsif block_given? %>
    <%= yield %>
  <% end %>
</div>

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
govuk_publishing_components-35.18.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-35.17.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-35.16.1 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-35.16.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-35.15.5 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-35.15.4 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-35.15.3 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-35.15.2 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-35.15.1 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-35.15.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-35.14.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-35.13.2 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-35.13.1 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-35.13.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-35.12.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-35.11.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-35.10.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-35.9.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-35.8.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-35.7.0 app/views/govuk_publishing_components/components/_govspeak.html.erb