Add instagram background implementation and generalize application for other identity providers
This commit is contained in:
@@ -1,12 +1,3 @@
|
||||
#FB.init appId: '168928633304849'
|
||||
|
||||
#Ember.Application.initializer
|
||||
#name: 'authentication',
|
||||
#initialize: (container, application)->
|
||||
## register the Facebook authenticator so the session can find it
|
||||
#container.register 'authenticators:facebook', App.FacebookAuthenticator
|
||||
#Ember.SimpleAuth.setup(container, application)
|
||||
|
||||
@App = Ember.Application.create
|
||||
LOG_TRANSITIONS: true
|
||||
rootElement: '#ember-app-container'
|
||||
|
||||
@@ -1,18 +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
|
||||
<% if Rails.env.test? %>
|
||||
url = ""
|
||||
<% else %>
|
||||
url = "http://graph.facebook.com/#{facebook_id}/picture?type=square"
|
||||
<% end %>
|
||||
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')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
each user in list.users
|
||||
img.facebook-image src="http://graph.facebook.com/#{unbound user.facebook_id}/picture?type=square" alt="f"
|
||||
user.avatar_tag
|
||||
.display-row
|
||||
.display-label=t 'attributes.list.created_at'
|
||||
.display-field=time list.created_at
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
h2= t 'join_request.existing_user.title'
|
||||
each join_request in join_requests
|
||||
.join-request-container
|
||||
= join_request.user.facebook_image_tag
|
||||
span.user-email= join_request.user.email
|
||||
= join_request.user.avatar_tag
|
||||
span.user-name= join_request.user.name
|
||||
.right
|
||||
button.join-request-reject{action "rejectRequest" join_request}=t 'join_request.existing_user.reject_request'
|
||||
button.join-request-approve{action "approveRequest" join_request}=t 'join_request.existing_user.approve_request'
|
||||
|
||||
Reference in New Issue
Block a user