Sha256: f6e59c699cdb553c34f55cbe9ad4bc7c0e4725004eadaa63a241b6baaba5c401

Contents?: true

Size: 836 Bytes

Versions: 48

Compression:

Stored size: 836 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) + ": #{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

48 entries across 48 versions & 1 rubygems

Version Path
alchemy_cms-5.3.8 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.3.7 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.3.6 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.3.5 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.3.4 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.3.3 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.3.2 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.3.1 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.3.0 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.2.7 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.2.6 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.1.10 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.0.10 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.2.5 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.1.9 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.0.9 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.2.4 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.1.8 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.0.8 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.0.7 app/helpers/alchemy/admin/essences_helper.rb