Add avatars on accounts list

This commit is contained in:
Piotr Sarnacki 2015-03-25 16:35:55 +01:00
parent d3bf48a415
commit a731028dfa
3 changed files with 6 additions and 1 deletions

View File

@ -4,6 +4,7 @@
Account = Model.extend
name: DS.attr()
type: DS.attr()
avatarUrl: DS.attr()
reposCount: DS.attr('number')
subscribed: DS.attr('boolean')
education: DS.attr('boolean')

View File

@ -19,7 +19,7 @@
{{#link-to "account" view.account class="name"}}
<div class="media">
<div class="media-elem">
<img src="//placehold.it/50x50" alt="">
<img {{bind-attr src="view.avatarUrl"}} alt="">
</div>
<div class="media-body">
<h2>{{view.name}}</h2>

View File

@ -25,6 +25,10 @@ View = Ember.CollectionView.extend
accountUrl(@get('account.login'))
).property('account.login')
avatarUrl: (->
@get('account.avatarUrl') || "//placehold.it/50x50"
).property('account.avatarUrl')
click: ->
@get('controller').transitionToRoute("account", @get('account.login'))