mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
correct count 0 on user filters
This commit is contained in:
parent
3d3b589b4d
commit
fd31f946ee
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
<div id='user-info'>
|
<div id='user-info'>
|
||||||
<nav class='buttons'>
|
<nav class='buttons'>
|
||||||
{{#if content.can_edit}}
|
{{#if content.can_edit}}
|
||||||
{{#linkTo "preferences" class="btn"}}{{i18n user.edit}}{{/linkTo}}
|
{{#linkTo "preferences" class="btn"}}{{i18n user.edit}}{{/linkTo}}
|
||||||
@ -13,7 +13,7 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
</nav>
|
</nav>
|
||||||
<div class='clearfix'></div>
|
<div class='clearfix'></div>
|
||||||
|
|
||||||
<ul class='action-list nav-stacked side-nav'>
|
<ul class='action-list nav-stacked side-nav'>
|
||||||
{{view Discourse.ActivityFilterView countBinding="statsCountNonPM"}}
|
{{view Discourse.ActivityFilterView countBinding="statsCountNonPM"}}
|
||||||
{{#each statsExcludingPms}}
|
{{#each statsExcludingPms}}
|
||||||
@ -47,7 +47,7 @@
|
|||||||
<button class='btn' data-not-implemented='true' disabled title="{{i18n not_implemented}}">{{i18n user.download_archive}}</button>
|
<button class='btn' data-not-implemented='true' disabled title="{{i18n not_implemented}}">{{i18n user.download_archive}}</button>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -10,25 +10,33 @@ Discourse.ActivityFilterView = Discourse.View.extend({
|
|||||||
tagName: 'li',
|
tagName: 'li',
|
||||||
classNameBindings: ['active'],
|
classNameBindings: ['active'],
|
||||||
|
|
||||||
active: (function() {
|
countChanged: function(){
|
||||||
var content;
|
this.rerender();
|
||||||
if (content = this.get('content')) {
|
}.observes('count'),
|
||||||
|
|
||||||
|
active: function() {
|
||||||
|
var content = this.get('content');
|
||||||
|
if (content) {
|
||||||
return parseInt(this.get('controller.content.streamFilter'), 10) === parseInt(Em.get(content, 'action_type'), 10);
|
return parseInt(this.get('controller.content.streamFilter'), 10) === parseInt(Em.get(content, 'action_type'), 10);
|
||||||
} else {
|
} else {
|
||||||
return this.blank('controller.content.streamFilter');
|
return this.blank('controller.content.streamFilter');
|
||||||
}
|
}
|
||||||
}).property('controller.content.streamFilter', 'content.action_type'),
|
}.property('controller.content.streamFilter', 'content.action_type'),
|
||||||
|
|
||||||
render: function(buffer) {
|
render: function(buffer) {
|
||||||
var content, count, description;
|
var content = this.get('content');
|
||||||
if (content = this.get('content')) {
|
var count, description;
|
||||||
|
|
||||||
|
if (content) {
|
||||||
count = Em.get(content, 'count');
|
count = Em.get(content, 'count');
|
||||||
description = Em.get(content, 'description');
|
description = Em.get(content, 'description');
|
||||||
} else {
|
} else {
|
||||||
count = this.get('count');
|
count = this.get('count');
|
||||||
description = Em.String.i18n("user.filters.all");
|
description = Em.String.i18n("user.filters.all");
|
||||||
}
|
}
|
||||||
return buffer.push("<a href='#'>" + description + " <span class='count'>(" + count + ")</span><span class='icon-chevron-right'></span></a>");
|
|
||||||
|
buffer.push("<a href='#'>" + description +
|
||||||
|
" <span class='count'>(" + count + ")</span><span class='icon-chevron-right'></span></a>");
|
||||||
},
|
},
|
||||||
|
|
||||||
click: function() {
|
click: function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user