Module: Alchemy::Admin::EssencesHelper

Included in:
ElementsHelper
Defined in:
app/helpers/alchemy/admin/essences_helper.rb

Instance Method Summary collapse

Instance Method Details

#edit_picture_dialog_size(content) ⇒ Object

Size value for edit picture dialog


22
23
24
25
26
27
28
# File 'app/helpers/alchemy/admin/essences_helper.rb', line 22

def edit_picture_dialog_size(content)
  if content.settings[:caption_as_textarea]
    content.settings[:sizes] ? "380x320" : "380x300"
  else
    content.settings[:sizes] ? "380x290" : "380x255"
  end
end

#essence_picture_thumbnail(content) ⇒ Object

Renders a thumbnail for given EssencePicture content with correct cropping and size


7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/helpers/alchemy/admin/essences_helper.rb', line 7

def essence_picture_thumbnail(content)
  picture = content.ingredient
  essence = content.essence

  return if picture.nil?

  image_tag(
    essence.thumbnail_url,
    alt: picture.name,
    class: "img_paddingtop",
    title: Alchemy.t(:image_name) + ": #{picture.name}",
  )
end