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.1.0.beta2 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.1.0.beta1 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.0.1 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.0.0 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.0.0.rc2 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.0.0.rc1 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.0.0.beta2 app/helpers/alchemy/admin/essences_helper.rb
alchemy_cms-5.0.0.beta1 app/helpers/alchemy/admin/essences_helper.rb