FIX: Bugs on Admin User approval interface

This commit is contained in:
Robin Ward 2013-07-15 11:28:41 -04:00
parent ed60f24502
commit 08723f00c6
3 changed files with 8 additions and 6 deletions

View File

@ -13,6 +13,10 @@ Discourse.AdminUsersListController = Ember.ArrayController.extend(Discourse.Pres
content: null,
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
@ -58,10 +62,8 @@ Discourse.AdminUsersListController = Ember.ArrayController.extend(Discourse.Pres
@property showApproval
**/
showApproval: function() {
if (!Discourse.SiteSettings.must_approve_users) return false;
if (this.get('query') === 'new') return true;
if (this.get('query') === 'pending') return true;
}.property('query'),
return Discourse.SiteSettings.must_approve_users && this.get('queryHasApproval');
}.property('queryPending'),
/**
How many users are currently selected

View File

@ -53,7 +53,7 @@
{{#each model}}
<tr {{bindAttr class="selected"}}>
{{#if showApproval}}
{{#if controller.showApproval}}
<td>
{{#if can_approve}}
{{view Ember.Checkbox checkedBinding="selected"}}

View File

@ -43,7 +43,7 @@ Ember.Handlebars.registerHelper('i18n', function(property, options) {
Ember.Handlebars.registerHelper('countI18n', function(key, options) {
var view = Discourse.View.extend({
tagName: 'span',
shouldRerender: Discourse.View.renderIfChanged('countChanged'),
shouldRerender: Discourse.View.renderIfChanged('count'),
render: function(buffer) {
buffer.push(I18n.t(key, { count: this.get('count') }));