<%= simple_form_for field_group, url: get_form_field_group_url, defaults: { label: false }, html: { class: 'form-body' } do |f| %> <% if field_group.errors.any? %>

<%= pluralize( field_group.errors.count, "error") %> prohibited this field_group from being saved:

    <% field_group.errors.full_messages.each do |message| %>
  • <%= message %>
  • <% end %>
<% end %>

<%= "#{ t :details }".capitalize %>

<%= "#{ t :title }".capitalize %>
<%= f.input :name %> <% if field_group.slug.nil? %> <%= f.input :slug, as: :hidden %> <% else %>
<%= "#{ t :slug }".capitalize %>
<%= f.input :slug, disabled: true, hint: "#{ t :slug_disable_hint }" %> <% end %>
<%= render "form_section", section: field_group, f: f, structure: @structure %>
<% field_group.field_settings.where( field_type: 'repeater' ).order( :position ).each do |repeater| %>

<%= repeater.name.capitalize %>

<%= render "form_section_repeater", section: field_group, f: f, structure: @structure, repeater: repeater %>
<% end %>

<%= "#{ t :setting }".pluralize.capitalize %>

<%= f.button :submit, 'Save changes', class: 'btn btn-primary' %>
<% end %>