mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 12:28:59 +08:00
FIX: Bugs on Admin User approval interface
This commit is contained in:
parent
ed60f24502
commit
08723f00c6
|
@ -13,6 +13,10 @@ Discourse.AdminUsersListController = Ember.ArrayController.extend(Discourse.Pres
|
||||||
content: null,
|
content: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
|
|
||||||
|
queryNew: Em.computed.equal('query', 'new'),
|
||||||
|
queryPending: Em.computed.equal('query', 'pending'),
|
||||||
|
queryHasApproval: Em.computed.or('queryNew', 'queryPending'),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Triggered when the selectAll property is changed
|
Triggered when the selectAll property is changed
|
||||||
|
|
||||||
|
@ -58,10 +62,8 @@ Discourse.AdminUsersListController = Ember.ArrayController.extend(Discourse.Pres
|
||||||
@property showApproval
|
@property showApproval
|
||||||
**/
|
**/
|
||||||
showApproval: function() {
|
showApproval: function() {
|
||||||
if (!Discourse.SiteSettings.must_approve_users) return false;
|
return Discourse.SiteSettings.must_approve_users && this.get('queryHasApproval');
|
||||||
if (this.get('query') === 'new') return true;
|
}.property('queryPending'),
|
||||||
if (this.get('query') === 'pending') return true;
|
|
||||||
}.property('query'),
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
How many users are currently selected
|
How many users are currently selected
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
|
|
||||||
{{#each model}}
|
{{#each model}}
|
||||||
<tr {{bindAttr class="selected"}}>
|
<tr {{bindAttr class="selected"}}>
|
||||||
{{#if showApproval}}
|
{{#if controller.showApproval}}
|
||||||
<td>
|
<td>
|
||||||
{{#if can_approve}}
|
{{#if can_approve}}
|
||||||
{{view Ember.Checkbox checkedBinding="selected"}}
|
{{view Ember.Checkbox checkedBinding="selected"}}
|
||||||
|
|
|
@ -43,7 +43,7 @@ Ember.Handlebars.registerHelper('i18n', function(property, options) {
|
||||||
Ember.Handlebars.registerHelper('countI18n', function(key, options) {
|
Ember.Handlebars.registerHelper('countI18n', function(key, options) {
|
||||||
var view = Discourse.View.extend({
|
var view = Discourse.View.extend({
|
||||||
tagName: 'span',
|
tagName: 'span',
|
||||||
shouldRerender: Discourse.View.renderIfChanged('countChanged'),
|
shouldRerender: Discourse.View.renderIfChanged('count'),
|
||||||
|
|
||||||
render: function(buffer) {
|
render: function(buffer) {
|
||||||
buffer.push(I18n.t(key, { count: this.get('count') }));
|
buffer.push(I18n.t(key, { count: this.get('count') }));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user