about summary refs log tree commit diff
path: root/app/helpers/application_helper.rb
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2020-06-26 13:02:14 +0200
committerThibaut Girka <thib@sitedethib.com>2020-06-26 13:02:14 +0200
commita01674fb2b4eb210b300b380899d388b0807999a (patch)
treed497e4b75d85ad5e8dd29416775730d29e13f79d /app/helpers/application_helper.rb
parent8f4aff9b6fe638b26b9d0bf0fe4151c2cc214d6d (diff)
parent08cf81f8c1b445eba9972214869c376fe6097efb (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r--app/helpers/application_helper.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 2f11ccb6f..9ca11d573 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -77,6 +77,18 @@ module ApplicationHelper
     content_tag(:i, nil, attributes.merge(class: class_names.join(' ')))
   end
 
+  def visibility_icon(status)
+    if status.public_visibility?
+      fa_icon('globe', title: I18n.t('statuses.visibilities.public'))
+    elsif status.unlisted_visibility?
+      fa_icon('unlock', title: I18n.t('statuses.visibilities.unlisted'))
+    elsif status.private_visibility? || status.limited_visibility?
+      fa_icon('lock', title: I18n.t('statuses.visibilities.private'))
+    elsif status.direct_visibility?
+      fa_icon('envelope', title: I18n.t('statuses.visibilities.direct'))
+    end
+  end
+
   def custom_emoji_tag(custom_emoji, animate = true)
     if animate
       image_tag(custom_emoji.image.url, class: 'emojione', alt: ":#{custom_emoji.shortcode}:")