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.1.10 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.1.9 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.1.8 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.1.7 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.1.6 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.1.5 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.14 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.1.4 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.13 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.1.3 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.1.2 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.1.1 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.1.0 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.12 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.11 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.10 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.9 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.8 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.7 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-6.0.6 app/helpers/alchemy/admin/essences_helper.rb