Link queued post avatar and username to user profile

This commit is contained in:
Robin Ward 2015-04-20 16:18:00 -04:00
parent 5990ab855b
commit 2c53a8b7bc
3 changed files with 16 additions and 3 deletions

View File

@ -0,0 +1,6 @@
export default Ember.Component.extend({
tagName: 'a',
attributeBindings: ['href', 'data-user-card'],
href: Ember.computed.alias('user.path'),
'data-user-card': Ember.computed.alias('user.username_lower')
});

View File

@ -3,11 +3,18 @@
{{#each ctrl in model itemController='queued-post'}}
<div class='queued-post'>
<div class='poster'>
{{avatar ctrl.post.user imageSize="large"}}
{{#user-link user=ctrl.post.user}}
{{avatar ctrl.post.user imageSize="large"}}
{{/user-link}}
</div>
<div class='cooked'>
<div class='names'>
<span class='username'>{{ctrl.post.user.username}}</span>
<span class="username">
{{#user-link user=ctrl.post.user}}
{{ctrl.post.user.username}}
{{/user-link}}
</span>
</div>
<div class='clearfix'></div>

View File

@ -12,7 +12,7 @@ class QueuedPostSerializer < ApplicationSerializer
:created_at,
:category_id
has_one :user, serializer: BasicUserSerializer, embed: :object
has_one :user, serializer: BasicUserSerializer
has_one :topic, serializer: BasicTopicSerializer
def category_id