diff --git a/app/models/services/facebook.rb b/app/models/services/facebook.rb index ff09e11ad..f294e3b36 100644 --- a/app/models/services/facebook.rb +++ b/app/models/services/facebook.rb @@ -31,11 +31,11 @@ class Services::Facebook < Service }, { "name": "Person to Invite", - "id": "abc123" + "id": "e3" }, { "name": "Creative Commons", - "id": "ccby" + "id": "b2" } ] } diff --git a/db/seeds.rb b/db/seeds.rb index 70dbdbec7..60211460c 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -15,9 +15,9 @@ require 'factory_girl_rails' require 'spec/helper_methods' include HelperMethods -alice = Factory(:user_with_aspect, :username => "alice", :password => 'evankorth') -bob = Factory(:user_with_aspect, :username => "bob", :password => 'evankorth') -eve = Factory(:user_with_aspect, :username => "eve", :password => 'evankorth') +alice = Factory(:user_with_aspect, :username => "alice", :password => 'evankorth', :invites => 10) +bob = Factory(:user_with_aspect, :username => "bob", :password => 'evankorth', :invites => 10) +eve = Factory(:user_with_aspect, :username => "eve", :password => 'evankorth', :invites => 10) alice.person.profile.update_attributes(:first_name => "Alice", :last_name => "Smith") bob.person.profile.update_attributes(:first_name => "Bob", :last_name => "Grimm") @@ -25,3 +25,7 @@ eve.person.profile.update_attributes(:first_name => "Eve", :last_name => "Doe") connect_users(bob, bob.aspects.first, alice, alice.aspects.first) connect_users(bob, bob.aspects.first, eve, eve.aspects.first) + +alice.services << Services::Facebook.create(:user_id => alice.id, :uid => 'a1') +bob.services << Services::Facebook.create(:user_id => bob.id, :uid => 'b2') +eve.services << Services::Facebook.create(:user_id => eve.id, :uid => 'e3') diff --git a/public/javascripts/friend-finder.js b/public/javascripts/friend-finder.js index 3727cbce2..988c821be 100644 --- a/public/javascripts/friend-finder.js +++ b/public/javascripts/friend-finder.js @@ -6,12 +6,18 @@ var FriendFinder = { initialize: function() { - alert("party time"); $('.contact_list .button').click(function(){ $this = $(this); - var uid = $this.parent('li').attr("uid"); - alert(uid); - $this.closest("options_"+uid).toggleClass("hidden").slideDown('slow', function(){}); + var uid = $this.parents('li').attr("uid"); + $this.parents('ul').children("#options_"+uid).slideToggle(function(){ + if($this.text() == 'Done'){ + $this.text($this.attr('old-text')); + } else { + $this.attr('old-text', $this.text()); + $this.text('Done'); + } + $(this).toggleClass('hidden'); + }); }); } };