Sha256: 5e9fc693c91dd098baf7830f44f5ef36f5401bb631fe2432f4522b5fdebb635f

Contents?: true

Size: 551 Bytes

Versions: 88

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

88 entries across 88 versions & 1 rubygems

Version Path
alchemy_cms-6.1.10 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-6.1.9 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-6.1.8 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-6.1.7 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-6.1.6 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-6.1.5 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-6.0.14 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-6.1.4 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.0.0.pre.a app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-6.0.13 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-6.1.3 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-6.1.2 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-6.1.1 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-6.1.0 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-6.0.12 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-6.0.11 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-6.0.10 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-5.3.8 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-6.0.9 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-5.3.7 app/helpers/alchemy/admin/attachments_helper.rb