1
0

settings_helper.rb 687 B

123456789101112131415161718192021222324252627
  1. # frozen_string_literal: true
  2. module SettingsHelper
  3. def filterable_languages
  4. LanguagesHelper::SUPPORTED_LOCALES.keys
  5. end
  6. def session_device_icon(session)
  7. device = session.detection.device
  8. if device.mobile?
  9. 'mobile'
  10. elsif device.tablet?
  11. 'tablet'
  12. else
  13. 'desktop'
  14. end
  15. end
  16. def compact_account_link_to(account)
  17. return if account.nil?
  18. link_to ActivityPub::TagManager.instance.url_for(account), class: 'name-tag', title: account.acct do
  19. safe_join([image_tag(account.avatar.url, width: 15, height: 15, alt: display_name(account), class: 'avatar'), content_tag(:span, account.acct, class: 'username')], ' ')
  20. end
  21. end
  22. end