Sha256: 1317f698ccd17f4bade913b80c5f7ea6c7df7696967b97dae96f5ffa70419adb

Contents?: true

Size: 931 Bytes

Versions: 2

Compression:

Stored size: 931 Bytes

Contents

<%
  add_gem_component_stylesheet("add-another")
  items ||= []
  empty ||= ""
  fieldset_legend ||= ""
  add_button_text ||= "Add another"
%>

<div data-module="add-another" class="gem-c-add-another" data-add-button-text="<%= add_button_text %>" data-fieldset-legend="<%= fieldset_legend %>">
  <% items.each_with_index do |item, index| %>
    <%= render "govuk_publishing_components/components/fieldset", {
      classes: "js-add-another__fieldset",
      legend_text: "#{fieldset_legend} #{index + 1}",
      heading_size: "m"
    } do %>
      <div class="js-add-another__destroy-checkbox">
        <%= item[:destroy_checkbox] %>
      </div>
      <%= item[:fields] %>
    <% end %>
  <% end %>
  <%= render "govuk_publishing_components/components/fieldset", {
    classes: "js-add-another__empty",
    legend_text: "#{fieldset_legend} #{items.length + 1}",
    heading_size: "m"
  } do %>
    <%= empty %>
  <% end %>
</div>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
govuk_publishing_components-46.0.0 app/views/govuk_publishing_components/components/_add_another.html.erb
govuk_publishing_components-45.10.0 app/views/govuk_publishing_components/components/_add_another.html.erb