diff --git a/app/assets/javascripts/discourse/models/user.js b/app/assets/javascripts/discourse/models/user.js index df389e88a75..3e401639a6a 100644 --- a/app/assets/javascripts/discourse/models/user.js +++ b/app/assets/javascripts/discourse/models/user.js @@ -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 diff --git a/app/assets/javascripts/discourse/templates/user/user.js.handlebars b/app/assets/javascripts/discourse/templates/user/user.js.handlebars index 6f498db37d5..e4d321d1b60 100644 --- a/app/assets/javascripts/discourse/templates/user/user.js.handlebars +++ b/app/assets/javascripts/discourse/templates/user/user.js.handlebars @@ -31,21 +31,21 @@
  • {{#link-to 'userPrivateMessages.index' model}} {{i18n user.messages.all}} - ({{private_messages_stats.all}}) + {{#if hasPMs}}({{private_messages_stats.all}}){{/if}} {{/link-to}}
  • {{#link-to 'userPrivateMessages.mine' model}} {{i18n user.messages.mine}} - ({{private_messages_stats.mine}}) + {{#if hasStartedPMs}}({{private_messages_stats.mine}}){{/if}} {{/link-to}}
  • {{#link-to 'userPrivateMessages.unread' model}} {{i18n user.messages.unread}} - ({{private_messages_stats.unread}}) + {{#if hasUnreadPMs}}({{private_messages_stats.unread}}){{/if}} {{/link-to}}