diff --git a/app/assets/javascripts/discourse/models/user.js b/app/assets/javascripts/discourse/models/user.js index 9dee51a5f70..1c083db60f5 100644 --- a/app/assets/javascripts/discourse/models/user.js +++ b/app/assets/javascripts/discourse/models/user.js @@ -25,7 +25,7 @@ Discourse.User = Discourse.Model.extend({ @type {String} **/ avatarSmall: (function() { - return Discourse.Utilities.avatarUrl(this.get('username'), 'small', this.get('avatar_template')); + return Discourse.Utilities.avatarUrl(this.get('username'), 'small', this.get('avatar_template')); }).property('username'), /** @@ -34,9 +34,13 @@ Discourse.User = Discourse.Model.extend({ @property websiteName @type {String} **/ - websiteName: (function() { + websiteName: function() { return this.get('website').split("/")[2]; - }).property('website'), + }.property('website'), + + hasWebsite: function() { + return this.present('website'); + }.property('website'), /** Path to this user. @@ -334,6 +338,7 @@ Discourse.User = Discourse.Model.extend({ onDetailsLoaded: function(callback){ var _this = this; + this.set("loading",false); if(callback){ this.onDetailsLoadedCallbacks = this.onDetailsLoadedCallbacks || []; @@ -353,6 +358,7 @@ Discourse.User = Discourse.Model.extend({ **/ loadDetails: function() { + this.set("loading",true); // Check the preload store first var user = this; var username = this.get('username'); diff --git a/app/assets/javascripts/discourse/templates/user/activity.js.handlebars b/app/assets/javascripts/discourse/templates/user/activity.js.handlebars index d0dfa900ebc..81900fda257 100644 --- a/app/assets/javascripts/discourse/templates/user/activity.js.handlebars +++ b/app/assets/javascripts/discourse/templates/user/activity.js.handlebars @@ -22,7 +22,7 @@
- {{#if content.website}} + {{#if content.hasWebsite}}
{{i18n user.website}}:
{{content.websiteName}}
{{/if}}
{{i18n user.created}}:
{{date content.created_at}}
diff --git a/app/assets/javascripts/discourse/templates/user/user.js.handlebars b/app/assets/javascripts/discourse/templates/user/user.js.handlebars index b3ab7e19973..eb29b6fe49c 100644 --- a/app/assets/javascripts/discourse/templates/user/user.js.handlebars +++ b/app/assets/javascripts/discourse/templates/user/user.js.handlebars @@ -1,3 +1,4 @@ +{{#unless content.loading}}
@@ -43,4 +44,4 @@
{{outlet userOutlet}}
- +{{/unless}}