<%= ff.input :field_group_id, as: :hidden %> <%= ff.input :id, as: :hidden %> <%= ff.input :ancestry, as: :hidden unless ff.object.is_root? %>
<%# - - - - - - - - - - - - %> <%# BUTTONS %> <%# - - - - - - - - - - - - %> <% if ff.object.slug.nil? %> <%= t('binda.delete').capitalize %>

<%= t('binda.new_item_in_repeater', { arg1: '' })%>

<% else %> <%= t('binda.collapse') %> <%= t('binda.expand') %> <%= link_to " #{t('binda.delete').capitalize}".html_safe, structure_field_group_field_setting_path( @structure, @field_group, ff.object ), method: :delete, data: { confirm: t('binda.confirm_delete') }, class: 'form-item--delete-repeater-item' %>

<%= ff.object.name %> (<%= ff.object.field_type.humanize.capitalize %>)

<% end %>
<%# - - - - - - - - - - - - %> <%# NAME %> <%# - - - - - - - - - - - - %>
<%= ff.input :name, as: :string, input_html: { class: "form-item--input" } %>
<% if ff.object.new_record? %> <%# - - - - - - - - - - - - %> <%# SLUG %> <%# - - - - - - - - - - - - %> <%= ff.input :slug, as: :hidden, input_html: { class: "form-item--input" } %> <%# - - - - - - - - - - - - %> <%# FIELD TYPE %> <%# - - - - - - - - - - - - %>
<% if ff.object.field_type.nil? %> <%= ff.input :field_type, as: :select, collection: get_field_types, include_blank: false, prompt: t(:select_field_type), input_html: { class: 'form-item--select-input' } %> <% else %> <%= ff.input :field_type, as: :string, disabled: true, input_html: { class: "form-item--input" } %> <% end %>
<% else %> <%# - - - - - - - - - - - - %> <%# SLUG %> <%# - - - - - - - - - - - - %>
<%= ff.input :slug, as: :string, input_html: { class: "form-item--input" } %>
<%# - - - - - - - - - - - - %> <%# FIELD TYPE %> <%# - - - - - - - - - - - - %>
<% if ff.object.field_type.nil? %> <%= ff.input :field_type, as: :select, collection: get_field_types, include_blank: false, prompt: t(:select_field_type), input_html: { class: 'form-item--select-input' } %> <% else %> <%= ff.input :field_type, as: :string, disabled: true, input_html: { class: "form-item--input" } %> <% end %>
<%# - - - - - - - - - - - - %> <%# DESCRIPTION %> <%# - - - - - - - - - - - - %>
<%= ff.input :description, input_html: { class: "form-item--input" } %>
<%# - - - - - - - - - - - - %> <%# POSITION %> <%# - - - - - - - - - - - - %>
<%= ff.input :position, as: :integer, input_html: { class: "form-item--input" } %>
<%# - - - - - - - - - - - - %> <%# ACCEPTED STRUCTURES %> <%# - - - - - - - - - - - - %> <% if ff.object.field_type == 'relation' %>
<%= ff.input :accepted_structure_ids, collection: Binda::Structure.all, as: :select, input_html: { multiple: true, class: 'select2-item' }, checked: ff.object.accepted_structures, include_blank: false, include_hidden: false %>
<% end %> <% choiceables = ['radio', 'selection', 'checkbox'] %> <% if choiceables.include? ff.object.field_type %> <%# - - - - - - - - - - - - %> <%# CHOICES %> <%# - - - - - - - - - - - - %> <%= render 'form_item_choice', f: f, ff: ff %> <% end %> <% end %>