<%= simple_form_for @component, url: get_form_component_url, defaults: { label: false }, html: { class: 'form-body' } do |f| %> <%= f.error_notification %> <%# - - - - - - - - - - - - %> <%# SET POSITION %> <%# - - - - - - - - - - - - %> <% unless @component.new_record? %> <%= f.input :position, as: :hidden %> <% end %>
<%# - - - - - - - - - - - - %> <%# NOTICE / ERRORS %> <%# - - - - - - - - - - - - %>

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

<%= "#{ t :title }".capitalize %>
<%= f.input :name %> <% if @component.slug.nil? %> <%= f.input :slug, as: :hidden %> <% else %>
<%= "#{ t :slug }".capitalize %>
<%= f.input :slug, disabled: true, hint: "#{ t :slug_disable_hint }" %> <% end %> <%= f.input :structure_id, as: :hidden, input_html: { value: @structure.id } %>
<%# - - - - - - - - - - - - %> <%# FIELD GROUP LOOP %> <%# - - - - - - - - - - - - %> <% @structure.field_groups.order( :position ).each_with_index do |field_group, index| %>

<%= field_group.name.capitalize %>

<% if @component.new_record? %>
<%= t( :hint_create_parent_before_child, arg1: "#{ t :component }", arg2: "#{ t :detail }" ).capitalize %>
<% else %> <% field_group.field_settings.order( :position ).each do |field_setting| %> <% next unless field_setting.is_root? %> <%= render "form_section", f: f, field_setting: field_setting %> <% end %> <% end %>
<% end %>
<%# - - - - - - - - - - - - %> <%# SIDEBAR %> <%# - - - - - - - - - - - - %>
<%= render "form_sidebar", f: f %>
<% end %>