<%= render 'layouts/binda/popup_warning' %>
<%= simple_form_for @field_group, url: get_form_field_group_url, html: { class: 'form-body' } do |f| %> <%= f.error_notification %> <% if f.object.errors.any? %>
<%= t('binda.standard_form_error_heading') %> <%= pluralize(f.object.errors.count, t("binda.standard_form_error")) %>:
<% end %>
<%= "#{ t :details }" %>
<%= f.input :name, label: "#{ t :title }" %> <% if @field_group.slug.nil? %> <%= f.input :slug, as: :hidden %> <% else %> <%= f.input :slug %> <% end %>
<%= "#{ t 'binda.field_settings' }" %>
<%= render "form_section", f: f %>
<% @field_group.field_settings.where( field_type: 'repeater' ).order( :position, :id ).each do |repeater| %>
<%= "#{ t('binda.repeater_field_settings', arg1: repeater.name ) }" %>
<%= render "form_section_repeater", f: f, repeater: repeater %>
<% end %>
<%= "#{ t :setting }".pluralize %>
<%= button_tag 'Save changes'.html_safe, { class: 'b-btn b-btn-primary b-btn-settings', id: 'save', 'data-entries-number': "Binda::#{@structure.instance_type.classify}".constantize.where(structure_id:@structure.id).count, 'data-instance-type': @structure.instance_type.pluralize } %>
<% end %>