<% Caboose.log(@block.block_type.field_type) update_on_close = false @block.block_type.children.each do |bt| update_on_close = true if bt.field_type == 'image' || bt.field_type == 'file' end crumbs = [] b = @block while b href = b.id == @block.id ? "#" : "/admin/pages/#{b.page_id}/blocks/#{b.id}/edit" onclick = b.id == @block.id ? " onclick=\"$('#block_#{@block.id}_block_type_id_container').slideToggle(100, function() { modal.autosize(); });\"" : '' text = b.name ? "#{b.block_type.description} (#{b.name})" : b.block_type.description crumbs << "#{text}" b = b.parent end %>

<%= raw crumbs.reverse.join(' > ') %>

<% if @block.block_type.use_render_function_for_layout %> <%= raw @block.render(@block, { :modal => true, :empty_text => '[Empty, click to edit]', :editing => true }) %> <% elsif @block.block_type.field_type != 'block' %>

<% else %> <% if @block.children.count > 0 %> <% @block.children.each do |b| %> <% if b.block_type.field_type != 'block' && b.block_type.field_type != 'richtext' %>

<% else %> <%= raw @block.render(b, { :modal => true, :empty_text => '[Empty, click to edit]', :editing => true }) %> <% end %> <% end %> <% else %>

This block doesn't have any content yet. <% if @block.block_type.allow_child_blocks %> Add a child block! <% end %>

<% end %> <% end %>

<% if @block.name.nil? %> <% end %>

<% content_for :caboose_css do %> <% end %> <% content_for :caboose_js do %> <%= javascript_include_tag "caboose/model/all" %> <%= javascript_include_tag "caboose/admin_block_edit" %> <% if @block.block_type.field_type == 'richtext' %> <%= tinymce_assets %> <%= tinymce :caboose, width: '800px', height:'300px' %> <% end %> <% end %>