2016-11-19 00:19:57 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module SettingsHelper
|
2017-09-08 12:32:22 +02:00
|
|
|
def filterable_languages
|
2023-10-04 09:23:50 +02:00
|
|
|
LanguagesHelper.sorted_locale_keys(LanguagesHelper::SUPPORTED_LOCALES.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def ui_languages
|
|
|
|
LanguagesHelper.sorted_locale_keys(I18n.available_locales)
|
2017-09-08 12:32:22 +02:00
|
|
|
end
|
|
|
|
|
2017-06-25 16:54:30 +02:00
|
|
|
def session_device_icon(session)
|
|
|
|
device = session.detection.device
|
|
|
|
|
|
|
|
if device.mobile?
|
|
|
|
'mobile'
|
|
|
|
elsif device.tablet?
|
|
|
|
'tablet'
|
|
|
|
else
|
|
|
|
'desktop'
|
|
|
|
end
|
|
|
|
end
|
2019-09-19 20:58:19 +02:00
|
|
|
|
|
|
|
def compact_account_link_to(account)
|
|
|
|
return if account.nil?
|
|
|
|
|
|
|
|
link_to ActivityPub::TagManager.instance.url_for(account), class: 'name-tag', title: account.acct do
|
2023-11-07 22:46:08 +01:00
|
|
|
safe_join([image_tag(account.avatar.url, width: 15, height: 15, alt: '', class: 'avatar'), content_tag(:span, account.acct, class: 'username')], ' ')
|
2019-09-19 20:58:19 +02:00
|
|
|
end
|
|
|
|
end
|
2016-11-19 00:19:57 +01:00
|
|
|
end
|