Sha256: b4ff9723afdb33b610966c8baca7f3c855ec49327a2658c6f0aded2caec9c3a4

Contents?: true

Size: 1.86 KB

Versions: 2

Compression:

Stored size: 1.86 KB

Contents

<%= render 'layouts/binda/popup_warning' %>
<%= simple_form_for [ @instance.structure, @instance ], html: { class: 'form-body', multipart: true } do |f| %>
  <%= f.error_notification %>
  <%= render 'layouts/binda/form_errors', f: f %>
  <% unless f.object.new_record? %>
    <%= f.input :position, as: :hidden %>
  <% end %>
  <div class="standard-form--body">
    <div class="standard-form--container">
      <div class="standard-form--header">
        <small><%= "#{ t :details }".capitalize %></small>
      </div>
      <div class="standard-form--fields">
        <%= f.input :name, label: "#{t('binda.title')}".capitalize %>
        <% if f.object.slug.nil? %>
          <%= f.input :slug, as: :hidden %>
        <% else %>
          <%= f.input :slug, disabled: true, hint: "#{ t :slug_disable_hint }" %>
        <% end %>
        <%= f.input :structure_id, as: :hidden, input_html: { value: @structure.id } %>
      </div>
    </div>
    <% @structure.field_groups.order( :position, :name ).each_with_index do |field_group, index| %>
      <div class="standard-form--container">
        <div class="standard-form--header">
          <small><%= field_group.name.capitalize %></small>
        </div>
        <% if f.object.new_record? %>
          <p class="standard-form--hint-on-new-record"><%= t( :hint_create_parent_before_child, arg1: "#{@structure.name} #{@structure.instance_type}", arg2: "#{ t :detail }" ).capitalize %></p>
        <% else %>
          <% field_group.field_settings.order( :position, :name ).each do |field_setting| %>
            <% next unless field_setting.is_root? %>
            <%= render "binda/fieldable/form_section", f: f, field_setting: field_setting %>
          <% end %>
        <% end %>
      </div>
    <% end %>
  </div>
  <div class="standard-form--container standard-form--sidebar">
    <%= render "binda/fieldable/form_sidebar", f: f %>
  </div>
<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
binda-0.1.5 app/views/binda/fieldable/_form_body.html.erb
binda-0.1.4 app/views/binda/fieldable/_form_body.html.erb