From c30784394f5c2d19878f9e5ac6bf80a62170fe3b Mon Sep 17 00:00:00 2001 From: David McClure Date: Tue, 12 Apr 2016 09:59:49 -0700 Subject: [PATCH] Feature: Show location and website on user card. (#4157) --- .../discourse/controllers/user-card.js.es6 | 6 ++++++ .../discourse/templates/user-card.hbs | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/app/assets/javascripts/discourse/controllers/user-card.js.es6 b/app/assets/javascripts/discourse/controllers/user-card.js.es6 index 38b2f10a564..bcb11c85112 100644 --- a/app/assets/javascripts/discourse/controllers/user-card.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user-card.js.es6 @@ -26,6 +26,7 @@ export default Ember.Controller.extend({ showBadges: setting('enable_badges'), showMoreBadges: Em.computed.gt('moreBadgesCount', 0), showDelete: Em.computed.and("viewingAdmin", "showName", "user.canBeDeleted"), + linkWebsite: Em.computed.not('user.isBasic'), @computed('user.user_fields.@each.value') publicUserFields() { @@ -40,6 +41,11 @@ export default Ember.Controller.extend({ } }, + @computed("user.trust_level") + removeNoFollow(trustLevel) { + return trustLevel > 2 && !this.siteSettings.tl3_links_no_follow; + }, + moreBadgesCount: function() { return this.get('user.badge_count') - this.get('user.featured_user_badges.length'); }.property('user.badge_count', 'user.featured_user_badges.@each'), diff --git a/app/assets/javascripts/discourse/templates/user-card.hbs b/app/assets/javascripts/discourse/templates/user-card.hbs index ecbc84d125a..5c948b62bbe 100644 --- a/app/assets/javascripts/discourse/templates/user-card.hbs +++ b/app/assets/javascripts/discourse/templates/user-card.hbs @@ -55,6 +55,23 @@ {{/link-to}} {{/if}} +
+ {{#if user.location}} + {{fa-icon "map-marker"}} {{user.location}} + {{/if}} + + {{#if user.website_name}} + + {{fa-icon "globe"}} + {{#if linkWebsite}} + {{user.website_name}} + {{else}} + {{user.website_name}} + {{/if}} + + {{/if}} +
+ {{#if user}}
{{#if user.last_posted_at}}