Sha256: 3c42afc192c1674854de94bc76be665336c9aea7cc3eee0b164763795eab4b8a

Contents?: true

Size: 834 Bytes

Versions: 39

Compression:

Stored size: 834 Bytes

Contents

# frozen_string_literal: true

module Alchemy
  module Admin
    module EssencesHelper
      # Renders a thumbnail for given EssencePicture content with correct cropping and size
      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, name: picture.name),
        )
      end

      # Size value for edit picture dialog
      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
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
alchemy_cms-6.0.5 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.4 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.3 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.2 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.1 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.0 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.0.pre.rc7 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.0.pre.rc6 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.0.pre.rc5 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.0.pre.rc4 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.0.pre.rc3 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.0.pre.rc2 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.0.pre.rc1 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.0.pre.b6 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.0.pre.b5 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.0.pre.b4 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.0.b3 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.0.b2 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.0.b1 app/helpers/alchemy/admin/essences_helper.rb