Sha256: ae98ce24df6a80ed5831dd457bb43d80c154efc01a45cde3cc35734b1cbb8421

Contents?: true

Size: 624 Bytes

Versions: 31

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

31 entries across 31 versions & 1 rubygems

Version Path
alchemy_cms-7.3.5 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.2.8 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.1.13 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.3.4 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.3.3 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.3.2 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.2.7 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.3.1 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.3.0 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.2.6 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.2.5 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.1.12 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.2.4 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.1.11 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.2.3 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.1.10 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.2.2 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.1.9 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.2.1 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.1.8 app/helpers/alchemy/admin/attachments_helper.rb