<% cache(content) do %> <%= content_tag :div, id: content.dom_id, data: {"content-id" => content.id}, class: [ "essence_picture_editor", options[:dragable] ? "dragable_picture" : nil, options[:grouped] ? nil : "content_editor" ].compact.join(" ") do %> <% unless options[:grouped] %><%= content_label(content) %><% end %>
<% if options[:grouped] %> <%= link_to_confirm_dialog "", Alchemy.t(:confirm_to_delete_image), alchemy.admin_essence_picture_path( id: content, options: options ), {title: Alchemy.t(:delete_image)} %> <% else %> <%= link_to '', '#', onclick: "return Alchemy.removePicture('##{content.form_field_id(:picture_id)}');" %> <% end %> <%- if content.ingredient -%>
<%- end -%>
<%- if content.ingredient -%> <%= essence_picture_thumbnail(content, options) %> <%= hidden_field_tag content.form_field_name(:picture_id), content.ingredient.id %> <% end %>
<%- if content.essence.css_class.present? -%>
<%= Alchemy.t("alchemy.essence_pictures.css_classes.#{content.essence.css_class}", default: content.essence.css_class.camelcase) %>
<%- end -%>
<%= render 'alchemy/essences/shared/essence_picture_tools', { content: content, options: options } %>
<%= hidden_field_tag content.form_field_name(:link), content.essence.link %> <%= hidden_field_tag content.form_field_name(:link_title), content.essence.link_title %> <%= hidden_field_tag content.form_field_name(:link_class_name), content.essence.link_class_name %> <%= hidden_field_tag content.form_field_name(:link_target), content.essence.link_target %> <% end %> <% end %>