about summary refs log tree commit diff
path: root/app/helpers
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2020-02-18 02:02:54 -0600
committermultiple creatures <dev@multiple-creature.party>2020-02-18 02:18:09 -0600
commit0f3b01eaab82325baaf1c7a4c75a322d3c21a67f (patch)
treef3d19c99328336997919803ffc6850a96d5a6411 /app/helpers
parentfc69e4a0bb4e3d2fdcb2ffef0f3211f8c347ed15 (diff)
switch to irc-like oper behavior; require mods & admins to explicitly oper up using `fangs`/`op` bangtag or toggling defang setting in profile; auto-defang after 15 mins or with `defang`/`deop` bangtag
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/accounts_helper.rb6
-rw-r--r--app/helpers/statuses_helper.rb4
2 files changed, 7 insertions, 3 deletions
diff --git a/app/helpers/accounts_helper.rb b/app/helpers/accounts_helper.rb
index c9e95d8d8..1a5f22e2a 100644
--- a/app/helpers/accounts_helper.rb
+++ b/app/helpers/accounts_helper.rb
@@ -64,14 +64,16 @@ module AccountsHelper
       content_tag(:div, content_tag(:div, t('accounts.roles.bot'), class: 'account-role bot'), class: 'roles')
     elsif account.group?
       content_tag(:div, content_tag(:div, t('accounts.roles.group'), class: 'account-role group'), class: 'roles')
-    elsif (Setting.show_staff_badge && account.user_staff?) || all
+    elsif (Setting.show_staff_badge && account.user_can_moderate?) || all
       content_tag(:div, class: 'roles') do
-        if all && !account.user_staff?
+        if all && !account.user_can_moderate?
           content_tag(:div, t('admin.accounts.roles.user'), class: 'account-role')
         elsif account.user_admin?
           content_tag(:div, t('accounts.roles.admin'), class: 'account-role admin')
         elsif account.user_moderator?
           content_tag(:div, t('accounts.roles.moderator'), class: 'account-role moderator')
+        elsif account.user_halfmod?
+          content_tag(:div, t('accounts.roles.halfmod'), class: 'account-role halfmod')
         end
       end
     end
diff --git a/app/helpers/statuses_helper.rb b/app/helpers/statuses_helper.rb
index d122a2860..574b3ad5c 100644
--- a/app/helpers/statuses_helper.rb
+++ b/app/helpers/statuses_helper.rb
@@ -56,13 +56,15 @@ module StatusesHelper
       roles << content_tag(:div, t('accounts.roles.gently'), class: 'account-role gently') if account.gently?
       roles << content_tag(:div, t('accounts.roles.kobold'), class: 'account-role kobold') if account.kobold?
 
-      if (Setting.show_staff_badge && account.user_staff?) || all
+      if (Setting.show_staff_badge && account.user_can_moderate?) || all
         if all && !account.user_staff?
           roles << content_tag(:div, t('admin.accounts.roles.user'), class: 'account-role')
         elsif account.user_admin?
           roles << content_tag(:div, t('accounts.roles.admin'), class: 'account-role admin')
         elsif account.user_moderator?
           roles << content_tag(:div, t('accounts.roles.moderator'), class: 'account-role moderator')
+        elsif account.user_halfmod?
+          roles << content_tag(:div, t('accounts.roles.halfmod'), class: 'account-role halfmod')
         end
       end