FIX: only show "new pm" in pm tab when looking at your own profile
This commit is contained in:
parent
4aa0d88c6c
commit
8f4e8fe8f2
|
@ -2,7 +2,7 @@ import ObjectController from 'discourse/controllers/object';
|
|||
|
||||
// Lists of topics on a user's page.
|
||||
export default ObjectController.extend(Discourse.HasCurrentUser, {
|
||||
needs: ["application"],
|
||||
needs: ["application", "user"],
|
||||
hideCategory: false,
|
||||
showParticipants: false,
|
||||
|
||||
|
@ -14,6 +14,11 @@ export default ObjectController.extend(Discourse.HasCurrentUser, {
|
|||
loadMore: function() {
|
||||
this.get('model').loadMore();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
showNewPM: function(){
|
||||
return this.get('controllers.user.viewingSelf') &&
|
||||
Discourse.User.currentProp('can_send_private_messages');
|
||||
}.property('controllers.user.viewingSelf'),
|
||||
|
||||
});
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{#if currentUser.can_send_private_messages}}
|
||||
{{#if showNewPM}}
|
||||
<div class="clearfix">
|
||||
<a class='btn btn-primary pull-right new-private-message' {{action "composePrivateMessage"}}>{{fa-icon "envelope"}}{{i18n user.new_private_message}}</a>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue