Sha256: fc99dfaa404640a6e67268c5102944d0c0b484a641b29d23cca4192a495f6014

Contents?: true

Size: 1.51 KB

Versions: 1

Compression:

Stored size: 1.51 KB

Contents

<% block_id = f.object.try(:block).try(:block_id) %>
<% block_kind = f.object.try(:block).try(:model_name).try(:name) %>
<% locals = { block_record: local_assigns.fetch(:block_record, nil) } %>

<%= content_tag :div,
                class: 'block-slot nested-fields',
                id: block_id,
                data: {
                  kind: block_kind } do %>
  <div class="panel panel-default">
    <div class="block-slot__panel-heading panel-heading sortable-handle" data-block-type-header>
      <div class="block-type-header-title">
        <% if f.object.block_kind %>
          <%= content_tag :div, '', class: "nested-fields__panel-display-icon #{f.object.block_kind.name.constantize.display_icon}" %>
          <%= f.object.block.try(:display_name) %>
          <span class="text-muted">
            <small><%= f.object.block_kind.description %></small>
          </span>
        <% end %>
      </div>

      <%= render 'admin/block_record/block_slot_field_buttons', f: f %>
    </div>

    <div class="block-slot__inputs panel-body">
      <% klass = f.object.block_kind.name.constantize %>
      <%= f.simple_fields_for :block do |f| %>
        <%= render "blocks/#{klass.model_name.singular}/edit", f: f, **locals %>
      <% end %>
    </div>
  </div>

  <%= f.association :block_layout, as: :hidden, input_html: { value: block_layout.id } %>
  <%= f.input :block_record_type, as: :hidden %>
  <%= f.input :block_kind_id, as: :hidden %>
  <%= f.input :position, as: :hidden, input_html: { class: 'block-position' } %>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
forest_cms-0.98.1 app/views/admin/block_record/_block_slot_fields.html.erb