Feature: Show location and website on user card. (#4157)

This commit is contained in:
David McClure 2016-04-12 09:59:49 -07:00 committed by Robin Ward
parent 64df98e348
commit c30784394f
2 changed files with 23 additions and 0 deletions

View File

@ -26,6 +26,7 @@ export default Ember.Controller.extend({
showBadges: setting('enable_badges'), showBadges: setting('enable_badges'),
showMoreBadges: Em.computed.gt('moreBadgesCount', 0), showMoreBadges: Em.computed.gt('moreBadgesCount', 0),
showDelete: Em.computed.and("viewingAdmin", "showName", "user.canBeDeleted"), showDelete: Em.computed.and("viewingAdmin", "showName", "user.canBeDeleted"),
linkWebsite: Em.computed.not('user.isBasic'),
@computed('user.user_fields.@each.value') @computed('user.user_fields.@each.value')
publicUserFields() { 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() { moreBadgesCount: function() {
return this.get('user.badge_count') - this.get('user.featured_user_badges.length'); return this.get('user.badge_count') - this.get('user.featured_user_badges.length');
}.property('user.badge_count', 'user.featured_user_badges.@each'), }.property('user.badge_count', 'user.featured_user_badges.@each'),

View File

@ -55,6 +55,23 @@
{{/link-to}} {{/link-to}}
{{/if}} {{/if}}
<div>
{{#if user.location}}
<span class='location'>{{fa-icon "map-marker"}} {{user.location}}</span>
{{/if}}
{{#if user.website_name}}
<span class='website-name'>
{{fa-icon "globe"}}
{{#if linkWebsite}}
<a href={{user.website}} rel={{unless removeNoFollow 'nofollow'}} target="_blank">{{user.website_name}}</a>
{{else}}
<span title={{user.website}}>{{user.website_name}}</span>
{{/if}}
</span>
{{/if}}
</div>
{{#if user}} {{#if user}}
<div class="metadata"> <div class="metadata">
{{#if user.last_posted_at}} {{#if user.last_posted_at}}