Sha256: ae98ce24df6a80ed5831dd457bb43d80c154efc01a45cde3cc35734b1cbb8421

Contents?: true

Size: 624 Bytes

Versions: 32

Compression:

Stored size: 624 Bytes

Contents

# frozen_string_literal: true

module Alchemy
  module Admin
    module AttachmentsHelper
      include Alchemy::Admin::BaseHelper
      include Alchemy::Filetypes

      def mime_to_human(mime)
        Alchemy.t(mime, scope: "mime_types", default: Alchemy.t(:document))
      end

      def attachment_preview_size(attachment)
        case attachment.file_mime_type
        when *IMAGE_FILE_TYPES then "600x475"
        when *AUDIO_FILE_TYPES then "600x190"
        when *VIDEO_FILE_TYPES then "600x485"
        when "application/pdf" then "600x600"
        else
          "600x145"
        end
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
alchemy_cms-7.1.8 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.1.7 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.1.6 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.1.5 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.1.4 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.1.3 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.1.2 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.1.1 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.1.0 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.1.0.pre.rc1 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.1.0.pre.b2 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.1.0.pre.b1 app/helpers/alchemy/admin/attachments_helper.rb