mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Add a page in admin to view trust level 3 requirements for a user. Only shows for users who are currently at trust level 2.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.AdminUserController = Discourse.ObjectController.extend({
|
||||
Discourse.AdminUserIndexController = Discourse.ObjectController.extend({
|
||||
editingTitle: false,
|
||||
|
||||
showApproval: function() {
|
||||
|
||||
@@ -42,7 +42,9 @@ Discourse.Route.buildRoutes(function() {
|
||||
this.route('groups', {path: '/groups'});
|
||||
|
||||
this.resource('adminUsers', { path: '/users' }, function() {
|
||||
this.resource('adminUser', { path: '/:username' });
|
||||
this.resource('adminUser', { path: '/:username' }, function() {
|
||||
this.route('leaderRequirements', { path: '/leader_requirements' });
|
||||
});
|
||||
this.resource('adminUsersList', { path: '/list' }, function() {
|
||||
_.each(['active', 'new', 'pending', 'admins', 'moderators', 'blocked', 'suspended',
|
||||
'newuser', 'basic', 'regular', 'leaders', 'elders'], function(x) {
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
Shows all the requirements for being at trust level 3 and if the
|
||||
given user is meeting them.
|
||||
|
||||
@class AdminUserLeaderRequirementsRoute
|
||||
@extends Discourse.Route
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.AdminUserLeaderRequirementsRoute = Discourse.Route.extend({
|
||||
model: function() {
|
||||
return this.controllerFor('adminUser').get('model');
|
||||
}
|
||||
});
|
||||
@@ -38,3 +38,9 @@ Discourse.AdminUserRoute = Discourse.Route.extend({
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Discourse.AdminUserIndexRoute = Discourse.Route.extend({
|
||||
setupController: function(c) {
|
||||
c.set('model', this.controllerFor('adminUser').get('model'));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -189,12 +189,16 @@
|
||||
{{combobox content=trustLevels value=trust_level nameProperty="detailedName"}}
|
||||
</div>
|
||||
<div class="controls">
|
||||
{{#if dirty}}
|
||||
<div>
|
||||
<button class='btn ok' {{action saveTrustLevel target="content"}}><i class='fa fa-check'></i></button>
|
||||
<button class='btn cancel' {{action restoreTrustLevel target="content"}}><i class='fa fa-times'></i></button>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if leader_requirements}}
|
||||
{{#link-to 'adminUser.leaderRequirements' this class="btn"}}{{i18n admin.user.trust_level_3_requirements}}{{/link-to}}
|
||||
{{/if}}
|
||||
|
||||
{{#if dirty}}
|
||||
<div>
|
||||
<button class='btn ok' {{action saveTrustLevel target="content"}}><i class='fa fa-check'></i></button>
|
||||
<button class='btn cancel' {{action restoreTrustLevel target="content"}}><i class='fa fa-times'></i></button>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
<div class='admin-controls'>
|
||||
<div class='span15'>
|
||||
<ul class="nav nav-pills">
|
||||
<li>{{#link-to 'adminUser' this}}{{i18n go_back}}{{/link-to}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin-container">
|
||||
<h2>{{username}} - {{i18n admin.user.tl3_requirements.title}}</h2>
|
||||
<br/>
|
||||
<p>{{i18n admin.user.tl3_requirements.table_title}}</p>
|
||||
|
||||
{{#with leader_requirements}}
|
||||
<table class="table" style="width: 50%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>{{i18n admin.user.tl3_requirements.visits}}</th>
|
||||
<td>
|
||||
<strong>{{days_visited_percent}}%</strong> ({{days_visited}} / {{time_period}} {{i18n admin.user.tl3_requirements.days}})
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{i18n admin.user.tl3_requirements.topics_with_replies}}</th>
|
||||
<td>
|
||||
{{num_topics_with_replies}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{i18n admin.user.tl3_requirements.topics_replied_to}}</th>
|
||||
<td>
|
||||
{{num_topics_replied_to}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{i18n admin.user.tl3_requirements.quality_content}}</th>
|
||||
<td style="color: #ccc;">
|
||||
TODO
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{i18n admin.user.tl3_requirements.reading}}</th>
|
||||
<td style="color: #ccc;">
|
||||
TODO
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{i18n admin.user.tl3_requirements.site_promotion}}</th>
|
||||
<td style="color: #ccc;">
|
||||
TODO
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{i18n admin.user.tl3_requirements.flagged_posts}}</th>
|
||||
<td>
|
||||
{{num_flagged_posts}}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{{/with}}
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user