accounts_helper.rb 568 B

12345678910111213141516171819
  1. # frozen_string_literal: true
  2. module Admin::AccountsHelper
  3. def admin_accounts_moderation_options
  4. [
  5. [t('admin.accounts.moderation.active'), 'active'],
  6. [t('admin.accounts.moderation.silenced'), 'silenced'],
  7. [t('admin.accounts.moderation.disabled'), 'disabled'],
  8. [t('admin.accounts.moderation.suspended'), 'suspended'],
  9. [safe_join([t('admin.accounts.moderation.pending'), "(#{pending_user_count_label})"], ' '), 'pending'],
  10. ]
  11. end
  12. private
  13. def pending_user_count_label
  14. number_with_delimiter User.pending.count
  15. end
  16. end