mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-23 07:32:02 +01:00
Add fa-fw class to user agent icon (#4047)
This commit is contained in:
parent
a6d02cff36
commit
92f1c474f3
2 changed files with 10 additions and 5 deletions
|
@ -31,7 +31,11 @@ module ApplicationHelper
|
||||||
Rails.env.production? ? site_title : "#{site_title} (Dev)"
|
Rails.env.production? ? site_title : "#{site_title} (Dev)"
|
||||||
end
|
end
|
||||||
|
|
||||||
def fa_icon(icon)
|
def fa_icon(icon, attributes = {})
|
||||||
content_tag(:i, nil, class: 'fa ' + icon.split(' ').map { |cl| "fa-#{cl}" }.join(' '))
|
class_names = attributes[:class]&.split(' ') || []
|
||||||
|
class_names << 'fa'
|
||||||
|
class_names += icon.split(' ').map { |cl| "fa-#{cl}" }
|
||||||
|
|
||||||
|
content_tag(:i, nil, attributes.merge(class: class_names.join(' ')))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,9 +11,10 @@
|
||||||
- @sessions.each do |session|
|
- @sessions.each do |session|
|
||||||
%tr
|
%tr
|
||||||
%td
|
%td
|
||||||
%span{ title: session.user_agent }= fa_icon session_device_icon(session)
|
%span{ title: session.user_agent }<
|
||||||
= ' '
|
= fa_icon "#{session_device_icon(session)} fw", 'aria-label' => session_device_icon(session)
|
||||||
= t 'sessions.description', browser: t("sessions.browsers.#{session.browser}"), platform: t("sessions.platforms.#{session.platform}")
|
= ' '
|
||||||
|
= t 'sessions.description', browser: t("sessions.browsers.#{session.browser}"), platform: t("sessions.platforms.#{session.platform}")
|
||||||
%td
|
%td
|
||||||
%samp= session.ip
|
%samp= session.ip
|
||||||
%td
|
%td
|
||||||
|
|
Loading…
Reference in a new issue