From 5e329898f6b4849e3584bb6d6b4dbdd73420525e Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 19 Feb 2016 15:32:10 +0800 Subject: [PATCH] UX: Don't display span if there is no count. --- app/assets/javascripts/admin/templates/groups_type.hbs | 6 +++++- app/assets/javascripts/discourse/models/group.js.es6 | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/admin/templates/groups_type.hbs b/app/assets/javascripts/admin/templates/groups_type.hbs index 980ca08c8f6..3c4fc3e5061 100644 --- a/app/assets/javascripts/admin/templates/groups_type.hbs +++ b/app/assets/javascripts/admin/templates/groups_type.hbs @@ -4,7 +4,11 @@ diff --git a/app/assets/javascripts/discourse/models/group.js.es6 b/app/assets/javascripts/discourse/models/group.js.es6 index d0048cc9577..a34c6dccae5 100644 --- a/app/assets/javascripts/discourse/models/group.js.es6 +++ b/app/assets/javascripts/discourse/models/group.js.es6 @@ -17,11 +17,11 @@ const Group = Discourse.Model.extend({ return this.get("automatic") ? "automatic" : "custom"; }.property("automatic"), - userCountDisplay: function(){ - var c = this.get('user_count'); + @computed('user_count') + userCountDisplay(userCount) { // don't display zero its ugly - if (c > 0) { return c; } - }.property('user_count'), + if (userCount > 0) { return userCount; } + }, findMembers() { if (Em.isEmpty(this.get('name'))) { return ; }