about summary refs log tree commit diff
path: root/app/helpers
diff options
context:
space:
mode:
authorpluralcafe-docker <git@plural.cafe>2018-10-13 01:09:02 +0000
committerpluralcafe-docker <git@plural.cafe>2018-10-13 01:09:02 +0000
commit7c96ee7815c216d6ac3b748d7dd6959376d3914e (patch)
treefd36bade02afa1536198e7f3beafb208973b68c5 /app/helpers
parentf9275cb762a311cbf298b3929552a153703c0726 (diff)
parent70d346ea951ebfa002225759310d72882a435a5c (diff)
Merge branch 'glitch'
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/admin/filter_helper.rb2
-rw-r--r--app/helpers/application_helper.rb20
2 files changed, 19 insertions, 3 deletions
diff --git a/app/helpers/admin/filter_helper.rb b/app/helpers/admin/filter_helper.rb
index 359c43d0e..60e5142e3 100644
--- a/app/helpers/admin/filter_helper.rb
+++ b/app/helpers/admin/filter_helper.rb
@@ -1,7 +1,7 @@
 # frozen_string_literal: true
 
 module Admin::FilterHelper
-  ACCOUNT_FILTERS      = %i(local remote by_domain silenced suspended recent username display_name email ip staff).freeze
+  ACCOUNT_FILTERS      = %i(local remote by_domain silenced suspended alphabetic username display_name email ip staff).freeze
   REPORT_FILTERS       = %i(resolved account_id target_account_id).freeze
   INVITE_FILTER        = %i(available expired).freeze
   CUSTOM_EMOJI_FILTERS = %i(local remote by_domain shortcode).freeze
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 6b41fd36e..e9b48fa98 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -7,8 +7,8 @@ module ApplicationHelper
     follow
   ).freeze
 
-  def active_nav_class(path)
-    current_page?(path) ? 'active' : ''
+  def active_nav_class(*paths)
+    paths.any? { |path| current_page?(path) } ? 'active' : ''
   end
 
   def active_link_to(label, path, **options)
@@ -82,4 +82,20 @@ module ApplicationHelper
     output << 'rtl' if locale_direction == 'rtl'
     output.reject(&:blank?).join(' ')
   end
+
+  def cdn_host
+    ENV['CDN_HOST'].presence
+  end
+
+  def cdn_host?
+    cdn_host.present?
+  end
+
+  def storage_host
+    ENV['S3_ALIAS_HOST'].presence || ENV['S3_CLOUDFRONT_HOST'].presence
+  end
+
+  def storage_host?
+    storage_host.present?
+  end
 end