Sha256: 94a7fc421c68fee0c1c4c753b8eb8990789e1795d995aeaade8651cf9d024c95

Contents?: true

Size: 899 Bytes

Versions: 14

Compression:

Stored size: 899 Bytes

Contents

# frozen_string_literal: true

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

14 entries across 14 versions & 1 rubygems

Version Path
alchemy_cms-4.0.6 app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-4.1.2 app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-4.1.1 app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-4.1.0 app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-4.0.5 app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-4.0.4 app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-4.1.0.rc1 app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-4.0.3 app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-4.0.2 app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-4.1.0.beta app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-4.0.1 app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-4.0.0 app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-4.0.0.rc2 app/helpers/alchemy/admin/pictures_helper.rb
alchemy_cms-4.0.0.rc1 app/helpers/alchemy/admin/pictures_helper.rb