Module: Alchemy::Admin::AttachmentsHelper

Includes:
BaseHelper
Defined in:
app/helpers/alchemy/admin/attachments_helper.rb

Instance Method Summary collapse

Methods included from BaseHelper

#alchemy_body_class, #alchemy_datepicker, #button_with_confirm, #clipboard_select_tag_options, #current_alchemy_user_name, #delete_button, #hint_with_tooltip, #js_filter_field, #link_to_confirm_dialog, #link_to_dialog, #link_url_regexp, #new_asset_path_with_session_information, #page_layout_missing_warning, #render_alchemy_title, #render_hint_for, #sites_for_select, #toolbar_button, #translations_for_select

Methods included from NavigationHelper

#alchemy_main_navigation_entry, #entry_active?, #main_navigation_css_classes, #navigate_module, #sorted_alchemy_modules, #url_for_module, #url_for_module_sub_navigation

Methods included from BaseHelper

#message_icon_class, #page_or_find, #render_flash_notice, #render_icon, #render_message, #shorten, #warning

Instance Method Details

#attachment_preview_size(attachment) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'app/helpers/alchemy/admin/attachments_helper.rb', line 12

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

#mime_to_human(mime) ⇒ Object



8
9
10
# File 'app/helpers/alchemy/admin/attachments_helper.rb', line 8

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