mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 17:03:13 +08:00
BUGFIX: do not show PMs counters when the value is 0
This commit is contained in:
parent
b6dd0cfb7d
commit
63c4f24319
|
@ -8,6 +8,10 @@
|
|||
**/
|
||||
Discourse.User = Discourse.Model.extend({
|
||||
|
||||
hasPMs: Em.computed.gt("private_messages_stats.all", 0),
|
||||
hasStartedPMs: Em.computed.gt("private_messages_stats.mine", 0),
|
||||
hasUnreadPMs: Em.computed.gt("private_messages_stats.unread", 0),
|
||||
|
||||
/**
|
||||
The user's stream
|
||||
|
||||
|
|
|
@ -31,21 +31,21 @@
|
|||
<li {{bind-attr class=":noGlyph privateMessagesActive:active"}}>
|
||||
{{#link-to 'userPrivateMessages.index' model}}
|
||||
{{i18n user.messages.all}}
|
||||
<span class='count'>({{private_messages_stats.all}})</span>
|
||||
{{#if hasPMs}}<span class='count'>({{private_messages_stats.all}})</span>{{/if}}
|
||||
<span class='fa fa-chevron-right'></span>
|
||||
{{/link-to}}
|
||||
</li>
|
||||
<li {{bind-attr class=":noGlyph privateMessagesMineActive:active"}}>
|
||||
{{#link-to 'userPrivateMessages.mine' model}}
|
||||
{{i18n user.messages.mine}}
|
||||
<span class='count'>({{private_messages_stats.mine}})</span>
|
||||
{{#if hasStartedPMs}}<span class='count'>({{private_messages_stats.mine}})</span>{{/if}}
|
||||
<span class='fa fa-chevron-right'></span>
|
||||
{{/link-to}}
|
||||
</li>
|
||||
<li {{bind-attr class=":noGlyph privateMessagesUnreadActive:active"}}>
|
||||
{{#link-to 'userPrivateMessages.unread' model}}
|
||||
{{i18n user.messages.unread}}
|
||||
<span class='count'>({{private_messages_stats.unread}})</span>
|
||||
{{#if hasUnreadPMs}}<span class='count'>({{private_messages_stats.unread}})</span>{{/if}}
|
||||
<span class='fa fa-chevron-right'></span>
|
||||
{{/link-to}}
|
||||
</li>
|
||||
|
|
Loading…
Reference in New Issue
Block a user