= semantic_form_for [:admin, resource], remote: true, html: { multipart: true } do |form| -#= @page.errors.full_messages = form.inputs id: 'image_fields' do = form.input :assetable_type, as: :hidden, input_html: { value: resource.assetable_type } = form.input :assetable_id, as: :hidden, input_html: { value: resource.assetable_id } = form.input :image_width, as: :hidden, input_html: { value: resource.assetable.activeadmin_selleo_cms_section.width } = form.input :image_height, as: :hidden, input_html: { value: resource.assetable.activeadmin_selleo_cms_section.height } = form.input :resize_method, as: :hidden, input_html: { value: resource.assetable.activeadmin_selleo_cms_section.resize_method } = form.input :data, label: "Image", hint: (resource.data.exists? ? image_tag(resource.data.url, style: "max-width:520px") : "No image") = form.input :caption = form.actions :submit = link_to_function "Crop image", "cropImage(#{resource.id}, #{resource.assetable.activeadmin_selleo_cms_section.width}, #{resource.assetable.activeadmin_selleo_cms_section.height})" unless resource.data.blank?