From c037371be154bfefaf0103c2b46fd8260ee74140 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 15 Jul 2014 14:46:12 -0400 Subject: [PATCH] FIX: Don't link to web sites for TL0 --- .../discourse/controllers/user.js.es6 | 16 ++++++++-------- app/assets/javascripts/discourse/models/user.js | 14 +------------- .../discourse/templates/user/user.js.handlebars | 9 ++++++++- 3 files changed, 17 insertions(+), 22 deletions(-) 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 @@
{{location}}
{{/if}} {{#if websiteName}} -
{{i18n user.website}}
{{websiteName}}
+
{{i18n user.website}}
+
+ {{#if linkWebsite}} + {{websiteName}} + {{else}} + {{websiteName}} + {{/if}} +
{{/if}} {{#if created_at}}
{{i18n user.created}}
{{bound-date created_at}}