mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Add a count of blocked users on the dashboard
This commit is contained in:
@@ -49,6 +49,7 @@ class AdminDashboardData
|
||||
reports: REPORTS.map { |type| Report.find(type).as_json },
|
||||
admins: User.admins.count,
|
||||
moderators: User.moderators.count,
|
||||
blocked: User.blocked.count,
|
||||
top_referrers: IncomingLinksReport.find('top_referrers').as_json,
|
||||
top_traffic_sources: IncomingLinksReport.find('top_traffic_sources').as_json,
|
||||
top_referred_topics: IncomingLinksReport.find('top_referred_topics').as_json
|
||||
|
||||
@@ -61,6 +61,7 @@ class User < ActiveRecord::Base
|
||||
scope :admins, ->{ where(admin: true) }
|
||||
scope :moderators, ->{ where(moderator: true) }
|
||||
scope :staff, ->{ where("moderator or admin ") }
|
||||
scope :blocked, ->{ where(blocked: true) } # no index
|
||||
|
||||
module NewTopicDuration
|
||||
ALWAYS = -1
|
||||
|
||||
Reference in New Issue
Block a user