UX: Don't display span if there is no count.
This commit is contained in:
parent
ecca7b69bb
commit
4858187b0e
|
@ -4,7 +4,11 @@
|
||||||
<ul>
|
<ul>
|
||||||
{{#each group in controller}}
|
{{#each group in controller}}
|
||||||
<li>
|
<li>
|
||||||
{{#link-to "adminGroup" group.type group.name}}{{group.name}} <span class="count">{{group.userCountDisplay}}</span>{{/link-to}}
|
{{#link-to "adminGroup" group.type group.name}}{{group.name}}
|
||||||
|
{{#if group.userCountDisplay}}
|
||||||
|
<span class="count">{{group.userCountDisplay}}</span>
|
||||||
|
{{/if}}
|
||||||
|
{{/link-to}}
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -17,11 +17,11 @@ const Group = Discourse.Model.extend({
|
||||||
return this.get("automatic") ? "automatic" : "custom";
|
return this.get("automatic") ? "automatic" : "custom";
|
||||||
}.property("automatic"),
|
}.property("automatic"),
|
||||||
|
|
||||||
userCountDisplay: function(){
|
@computed('user_count')
|
||||||
var c = this.get('user_count');
|
userCountDisplay(userCount) {
|
||||||
// don't display zero its ugly
|
// don't display zero its ugly
|
||||||
if (c > 0) { return c; }
|
if (userCount > 0) { return userCount; }
|
||||||
}.property('user_count'),
|
},
|
||||||
|
|
||||||
findMembers() {
|
findMembers() {
|
||||||
if (Em.isEmpty(this.get('name'))) { return ; }
|
if (Em.isEmpty(this.get('name'))) { return ; }
|
||||||
|
|
Loading…
Reference in New Issue