Sha256: 817f620d5e13b289e607b34abc9f4ec3b27d4698e750528e5df03d149f1a95e3

Contents?: true

Size: 551 Bytes

Versions: 39

Compression:

Stored size: 551 Bytes

Contents

# frozen_string_literal: true

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

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

      def attachment_preview_size(attachment)
        case attachment.icon_css_class
        when 'image' then '600x475'
        when 'audio' then '600x190'
        when 'video' then '600x485'
        when 'pdf'   then '600x500'
        else
          '600x145'
        end
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
alchemy_cms-4.6.7 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-4.6.6 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-4.6.5 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-4.5.1 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-4.4.5 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-4.6.4 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-4.0.6 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-4.6.3 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-4.6.2 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-4.6.1 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-4.6.0 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-4.5.0 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-4.4.4 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-4.4.3 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-4.4.2 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-4.4.1 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-4.4.0 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-4.3.2 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-4.2.4 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-4.3.1 app/helpers/alchemy/admin/attachments_helper.rb