mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Add blocked users count to dashboard
This commit is contained in:
@@ -23,12 +23,9 @@ Discourse.AdminDashboardRoute = Discourse.Route.extend({
|
||||
_.each(d.reports,function(report){
|
||||
c.set(report.type, Discourse.Report.create(report));
|
||||
});
|
||||
c.set('admins', d.admins);
|
||||
c.set('moderators', d.moderators);
|
||||
c.set('blocked', d.blocked);
|
||||
c.set('top_referrers', d.top_referrers);
|
||||
c.set('top_traffic_sources', d.top_traffic_sources);
|
||||
c.set('top_referred_topics', d.top_referred_topics);
|
||||
_.each(['admins', 'moderators', 'blocked', 'banned', 'top_referrers', 'top_traffic_sources', 'top_referred_topics'], function(x) {
|
||||
c.set(x, d[x]);
|
||||
});
|
||||
c.set('loading', false);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -34,18 +34,10 @@ Discourse.Route.buildRoutes(function() {
|
||||
this.resource('adminUsers', { path: '/users' }, function() {
|
||||
this.resource('adminUser', { path: '/:username' });
|
||||
this.resource('adminUsersList', { path: '/list' }, function() {
|
||||
this.route('active', { path: '/active' });
|
||||
this.route('new', { path: '/new' });
|
||||
this.route('pending', { path: '/pending' });
|
||||
this.route('admins', { path: '/admins' });
|
||||
this.route('moderators', { path: '/moderators' });
|
||||
this.route('blocked', { path: '/blocked' });
|
||||
// Trust Levels:
|
||||
this.route('newuser', { path: '/newuser' });
|
||||
this.route('basic', { path: '/basic' });
|
||||
this.route('regular', { path: '/regular' });
|
||||
this.route('leaders', { path: '/leaders' });
|
||||
this.route('elders', { path: '/elders' });
|
||||
_.each(['active', 'new', 'pending', 'admins', 'moderators', 'blocked', 'banned',
|
||||
'newuser', 'basic', 'regular', 'leaders', 'elders'], function(x) {
|
||||
this.route(x, { path: '/' + x });
|
||||
}, this);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -94,4 +94,18 @@ Discourse.AdminUsersListBlockedRoute = Discourse.Route.extend({
|
||||
setupController: function() {
|
||||
return this.controllerFor('adminUsersList').show('blocked');
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
Handles the route that lists banned users.
|
||||
|
||||
@class AdminUsersListBannedRoute
|
||||
@extends Discourse.Route
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.AdminUsersListBannedRoute = Discourse.Route.extend({
|
||||
setupController: function() {
|
||||
return this.controllerFor('adminUsersList').show('banned');
|
||||
}
|
||||
});
|
||||
@@ -97,12 +97,20 @@
|
||||
</div>
|
||||
|
||||
<div class="dashboard-stats totals">
|
||||
<span class="title"><i class='icon icon-trophy'></i> {{i18n admin.dashboard.admins}}</span>
|
||||
<span class="value">{{#linkTo 'adminUsersList.admins'}}{{admins}}{{/linkTo}}</span>
|
||||
<span class="title"><i class='icon icon-magic'></i> {{i18n admin.dashboard.moderators}}</span>
|
||||
<span class="value">{{#linkTo 'adminUsersList.moderators'}}{{moderators}}{{/linkTo}}</span>
|
||||
<span class="title"><i class='icon icon-ban-circle'></i> {{i18n admin.dashboard.blocked}}</span>
|
||||
<span class="value">{{#linkTo 'adminUsersList.blocked'}}{{blocked}}{{/linkTo}}</span>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="title"><i class='icon icon-trophy'></i> {{i18n admin.dashboard.admins}}</td>
|
||||
<td class="value">{{#linkTo 'adminUsersList.admins'}}{{admins}}{{/linkTo}}</td>
|
||||
<td class="title"><i class='icon icon-ban-circle'></i> {{i18n admin.dashboard.banned}}</td>
|
||||
<td class="value">{{#linkTo 'adminUsersList.banned'}}{{banned}}{{/linkTo}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title"><i class='icon icon-magic'></i> {{i18n admin.dashboard.moderators}}</td>
|
||||
<td class="value">{{#linkTo 'adminUsersList.moderators'}}{{moderators}}{{/linkTo}}</td>
|
||||
<td class="title"><i class='icon icon-ban-circle'></i> {{i18n admin.dashboard.blocked}}</td>
|
||||
<td class="value">{{#linkTo 'adminUsersList.blocked'}}{{blocked}}{{/linkTo}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="dashboard-stats">
|
||||
|
||||
Reference in New Issue
Block a user