mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
UX: Don't display span if there is no count.
This commit is contained in:
parent
ecca7b69bb
commit
4858187b0e
2 changed files with 9 additions and 5 deletions
|
@ -4,7 +4,11 @@
|
|||
<ul>
|
||||
{{#each group in controller}}
|
||||
<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>
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
|
|
@ -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 ; }
|
||||
|
|
Loading…
Reference in a new issue