use avatar url with mm fallback

This commit is contained in:
Lisa Passing 2015-05-05 12:05:10 +02:00
parent 065796bc76
commit ab9697892f
2 changed files with 3 additions and 5 deletions

View File

@ -10,15 +10,13 @@ Controller = Ember.Controller.extend
avatarURL: (->
if @get('model.avatar_url')
"#{@get('model.avatar_url')}?s=128"
"#{@get('model.avatar_url')}?s=125"
else
'https://secure.gravatar.com/avatar/?d=mm&s=128'
'https://secure.gravatar.com/avatar/?d=mm&s=125'
).property()
owner: (->
data = @get('model')
console.log(data)
{
login: data.login
name: data.name

View File

@ -3,7 +3,7 @@
<header class="owner-header row">
<section class="columns small-10 medium-6">
<div class="owner-avatar">
<img {{bind-attr src="owner.avatarUrl"}} alt="" width="125" height="125">
<img {{bind-attr src="avatarURL"}} alt="" width="125" height="125">
</div>
<div class="owner-info">
<h1 class="owner-title">{{owner.name}}</h1>