Add instagram background implementation and generalize application for other identity providers
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
attr = DS.attr
|
||||
App.User= DS.Model.extend
|
||||
facebook_id: attr('string')
|
||||
email: attr('string')
|
||||
name: attr('string')
|
||||
uid: attr('string')
|
||||
provider: attr('string')
|
||||
avatar: attr('string')
|
||||
list: DS.belongsTo('list') # in ember scope not many to many (yet)
|
||||
join_requests: DS.hasMany('join_request')
|
||||
facebook_image_tag: (->
|
||||
facebook_id = @get('facebook_id')
|
||||
return '' unless facebook_id
|
||||
url = "http://graph.facebook.com/#{facebook_id}/picture?type=square"
|
||||
avatar_tag: (->
|
||||
return unless avatar = @get('avatar')
|
||||
name = @get('name')
|
||||
new Handlebars.SafeString "<img src=\"#{url}\" alt=\"#{name}\" title=\"#{name}\" class=\"user-facebook-image\">"
|
||||
).property('facebook_id', 'name')
|
||||
"<img src='#{avatar}' alt='#{name}' title='#{name}' class='user-avatar-image #{@get('provider')}'>".htmlSafe()
|
||||
).property('avatar', 'name')
|
||||
|
||||
Reference in New Issue
Block a user