Sha256: 997dc9087bb12188a1e1035cd5ec997f047544d455c92573462f929c3bc88892

Contents?: true

Size: 984 Bytes

Versions: 12

Compression:

Stored size: 984 Bytes

Contents

<%
  # button_helper.css_classes generates "gem-c-button"
  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
  local_assigns[:classes] = shared_helper.classes
  button = GovukPublishingComponents::Presenters::ButtonHelper.new(local_assigns)
%>

<% start_button_text = capture do %>
  <%= button.text %>
  <svg class="govuk-button__start-icon govuk-!-display-none-print" xmlns="http://www.w3.org/2000/svg" width="17.5" height="19" viewBox="0 0 33 40" role="presentation" focusable="false">
    <path fill="currentColor" d="M0 0h13l20 20-20 20H0l20-20z" />
  </svg>
<% end %>

<%
  if button.start
    button_text = start_button_text
  else
    button_text = button.text
  end
%>

<% if button.link? %>
  <%= link_to button_text, button.href, button.html_options %>
<% else %>
  <%= content_tag :button, button_text, button.html_options %>
<% end %>

<% if button.info_text %>
  <%= tag.span button.info_text, button.info_text_options %>
<% end %>

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
govuk_publishing_components-28.5.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-28.4.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-28.3.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-28.2.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-28.1.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-28.0.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-27.20.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-27.19.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-27.18.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-27.17.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-27.16.0 app/views/govuk_publishing_components/components/_button.html.erb
govuk_publishing_components-27.15.0 app/views/govuk_publishing_components/components/_button.html.erb