Show the user card when clicking on users in the directory

This commit is contained in:
Robin Ward 2015-03-20 15:40:28 -04:00
parent 6d38005a22
commit c6afeb2259
2 changed files with 6 additions and 4 deletions

View File

@ -1,6 +1,8 @@
export default Ember.Component.extend({
classNames: ['user-small'],
userPath: Discourse.computed.url('username', '/users/%@'),
name: function() {
const name = this.get('user.name');
if (name && this.get('user.username') !== name) {

View File

@ -1,11 +1,11 @@
<div class="user-image">
{{#link-to 'user' user.username}}{{avatar user imageSize="large"}}{{/link-to}}
<a href="{{unbound userPath}}" data-user-card="{{unbound user.username}}">{{avatar user imageSize="large"}}</a>
</div>
<div class="user-detail">
<div class='name-line'>
<span class="username">{{#link-to 'user' user.username}}{{user.username}}{{/link-to}}</span>
<span class="name">{{name}}</span>
<span class="username"><a href="{{unbound userPath}}" data-user-card="{{unbound user.username}}">{{unbound user.username}}</a></span>
<span class="name">{{unbound name}}</span>
</div>
<div class="title">{{user.title}}</div>
<div class="title">{{unbound user.title}}</div>
</div>