Sha256: a3fe2be07cc92908630acf881eb089b0720cf155966ee1264705e1cf10204a1e

Contents?: true

Size: 549 Bytes

Versions: 20

Compression:

Stored size: 549 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

20 entries across 20 versions & 1 rubygems

Version Path
alchemy_cms-7.0.16 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.0.15 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.0.14 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.0.13 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.0.12 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.0.11 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.0.10 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.0.9 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.0.8 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.0.7 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.0.6 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.0.5 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.0.4 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.0.3 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.0.2 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.0.1 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.0.0 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.0.0.pre.rc1 app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.0.0.pre.c app/helpers/alchemy/admin/attachments_helper.rb
alchemy_cms-7.0.0.pre.b app/helpers/alchemy/admin/attachments_helper.rb