about summary refs log tree commit diff
path: root/app/helpers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-03-26 01:24:19 +0100
committerGitHub <noreply@github.com>2019-03-26 01:24:19 +0100
commite11796432514afb49f3d891f805973a37f00fcf1 (patch)
treefae04acaf5cf1587b68904dd6cd77e7b556ef870 /app/helpers
parent9745de883b198375ba23f7fde879f6d75ce2df0f (diff)
Change icons of features on admin dashboard to remove bias (#10366)
Red crosses implied that it was bad/unexpected that certain features
were not enabled. In reality, they are options, so showing a green
or grey power-off icon is more appropriate.

Add status of timeline preview as well

Fix sample accounts changing too frequently due to wrong query

Sample accounts are intended to be sorted by popularity
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/admin/dashboard_helper.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/helpers/admin/dashboard_helper.rb b/app/helpers/admin/dashboard_helper.rb
new file mode 100644
index 000000000..4ee2cdef4
--- /dev/null
+++ b/app/helpers/admin/dashboard_helper.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+module Admin::DashboardHelper
+  def feature_hint(feature, enabled)
+    indicator   = safe_join([enabled ? t('simple_form.yes') : t('simple_form.no'), fa_icon('power-off fw')], ' ')
+    class_names = enabled ? 'pull-right positive-hint' : 'pull-right neutral-hint'
+
+    safe_join([feature, content_tag(:span, indicator, class: class_names)])
+  end
+end