Sha256: ff6ffa66d0cc1f77e1f2c27145bffc244ab6d2f72a126cdc9271954a3f918b5f

Contents?: true

Size: 868 Bytes

Versions: 12

Compression:

Stored size: 868 Bytes

Contents

module Alchemy
  module Admin
    module PicturesHelper
      def create_or_assign_url(picture_to_assign, options)
        if @content.nil?
          {
            controller: :contents,
            action: :create,
            picture_id: picture_to_assign.id,
            content: {
              essence_type: "Alchemy::EssencePicture",
              element_id: @element.id
            },
            options: options
          }
        else
          {
            controller: :essence_pictures,
            action: :assign,
            picture_id: picture_to_assign.id,
            content_id: @content.id,
            options: options
          }
        end
      end

      def preview_size(size)
        case size
        when 'small' then '80x60'
        when 'large' then '240x180'
        else
          '160x120'
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
alchemy_cms-3.6.7 app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-3.6.6 app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-3.6.5 app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-3.6.4 app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-3.6.3 app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-3.6.2 app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-3.6.1 app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-4.0.0.beta app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-3.6.0 app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-3.5.0 app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-3.5.0.rc2 app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-3.5.0.rc1 app/helpers/alchemy/admin/pictures_helper.rb