Merge pull request #1494 from ScotterC/present-user-name

Presenting name for user stream description
This commit is contained in:
Robin Ward 2013-10-08 08:42:59 -07:00
commit 0bda906da4

View File

@ -81,7 +81,7 @@ Discourse.UserAction = Discourse.Model.extend({
replyUrl: this.get('replyUrl'), replyUrl: this.get('replyUrl'),
postUrl: this.get('postUrl'), postUrl: this.get('postUrl'),
topicUrl: this.get('replyUrl'), topicUrl: this.get('replyUrl'),
user: this.get('name'), user: this.get('presentName'),
post_number: '#' + this.get('reply_to_post_number'), post_number: '#' + this.get('reply_to_post_number'),
user1Url: this.get('userUrl'), user1Url: this.get('userUrl'),
user2Url: this.get('targetUserUrl'), user2Url: this.get('targetUserUrl'),
@ -98,6 +98,8 @@ Discourse.UserAction = Discourse.Model.extend({
return this.get('target_username') === Discourse.User.currentProp('username'); return this.get('target_username') === Discourse.User.currentProp('username');
}.property('target_username'), }.property('target_username'),
presentName: Em.computed.any('name', 'username'),
targetUserUrl: Discourse.computed.url('target_username', '/users/%@'), targetUserUrl: Discourse.computed.url('target_username', '/users/%@'),
usernameLower: function() { usernameLower: function() {
return this.get('username').toLowerCase(); return this.get('username').toLowerCase();