diff --git a/app/assets/javascripts/discourse/controllers/user.js.es6 b/app/assets/javascripts/discourse/controllers/user.js.es6 index 5980cf04759..8ff4c0131ed 100644 --- a/app/assets/javascripts/discourse/controllers/user.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user.js.es6 @@ -1,11 +1,3 @@ -/** - This controller handles general user actions - - @class UserController - @extends Discourse.ObjectController - @namespace Discourse - @module Discourse -**/ export default Discourse.ObjectController.extend({ viewingSelf: function() { @@ -14,6 +6,14 @@ export default Discourse.ObjectController.extend({ collapsedInfo: Em.computed.not('indexStream'), + websiteName: function() { + var website = this.get('website'); + if (Em.isEmpty(website)) { return; } + return this.get('website').split("/")[2]; + }.property('website'), + + linkWebsite: Em.computed.not('isBasic'), + canSeePrivateMessages: function() { return this.get('viewingSelf') || Discourse.User.currentProp('admin'); }.property('viewingSelf'), diff --git a/app/assets/javascripts/discourse/models/user.js b/app/assets/javascripts/discourse/models/user.js index 1e99660aa1a..3719b78dc28 100644 --- a/app/assets/javascripts/discourse/models/user.js +++ b/app/assets/javascripts/discourse/models/user.js @@ -52,19 +52,6 @@ Discourse.User = Discourse.Model.extend({ return this.get('username'); }.property('username', 'name'), - /** - This user's website. - - @property websiteName - @type {String} - **/ - websiteName: function() { - var website = this.get('website'); - if (Em.isEmpty(website)) { return; } - - return this.get('website').split("/")[2]; - }.property('website'), - /** This user's profile background(in CSS). @@ -129,6 +116,7 @@ Discourse.User = Discourse.Model.extend({ return Discourse.Site.currentProp('trustLevels').findProperty('id', parseInt(this.get('trust_level'), 10)); }.property('trust_level'), + isBasic: Em.computed.equal('trust_level', 0), isLeader: Em.computed.equal('trust_level', 3), isElder: Em.computed.equal('trust_level', 4), canManageTopic: Em.computed.or('staff', 'isElder'), diff --git a/app/assets/javascripts/discourse/templates/user/user.js.handlebars b/app/assets/javascripts/discourse/templates/user/user.js.handlebars index e9ee00f74a3..a95f6462b57 100644 --- a/app/assets/javascripts/discourse/templates/user/user.js.handlebars +++ b/app/assets/javascripts/discourse/templates/user/user.js.handlebars @@ -107,7 +107,14 @@