.brick-item{ :id => brick.to_brick_item_id, :class => brick.to_style_class, 'data-id' => brick.id } = simple_form_for brick, :as => :brick, :url => kuhsaft.cms_brick_path(brick), :remote => !brick.uploader?, :html => { :id => nil }, :wrapper => :bootstrap do |form| = form.hidden_field :position, :class => 'position-field' .brick-item-header.clearfix .pull-left - if brick.caption.present? = brick.caption %span.muted = brick.backend_label(:parenthesis => true) .pull-right .btn-toolbar - # delete button - if brick.persisted? - if brick.user_can_delete? .btn-group = link_to kuhsaft.cms_brick_path(brick), :class => 'btn btn-small btn-danger', :confirm => t('kuhsaft.cms.bricks.brick_item.confirm'), :method => :delete, :remote => true do %i.icon-trash.icon-white - # possible styles - unless brick.available_display_styles.empty? .btn-group %a.btn.btn-small.dropdown-toggle{ 'data-toggle' => 'dropdown', 'href' => '#' } %i.icon-tint %ul.dropdown-menu.pull-right %li = form.input :display_styles, :collection => brick.available_display_styles, :as => :check_boxes - # addable child dropdown menu - if brick.respond_to?(:brick_list) .btn-group = render 'brick_type_dropdown', :brick_list => brick - brick_content = render(brick.to_edit_partial_path, :brick => brick, :form => form) - if brick_content.present? .brick-item-content = brick_content - if brick.user_can_save? - # save button .clearfix .pull-right %a.submit{ :href => '#', :class => 'btn btn-success btn-small ', 'data-title' => '', 'data-content' => t('.saved') } = t('.save') - if brick.renders_own_childs? .brick-item-childs = render brick.to_edit_childs_partial_path, :brick => brick - else - if brick.respond_to?(:bricks) .brick-item-childs = render 'kuhsaft/cms/bricks/brick_list', :brick_list => brick