Testing ignore friend request on remote

This commit is contained in:
ilya 2010-09-12 19:56:23 -07:00
parent 9b07c780c3
commit 6b7f0888d0
3 changed files with 31 additions and 3 deletions

View file

@ -3,7 +3,7 @@
= javascript_include_tag 'group-edit.js'
- content_for :left_pane do
%h1{:id => 'group_title'}
%h1
Requests
%li.requests
@ -14,6 +14,17 @@
.name
= request.person.real_name
%h1
Ignore/Remove
%li.remove
%ul
- for request in @remote_requests
%li.person{:id => request.person.id, :request_id => request.id}
= image_tag(request.person.profile.image_url(:thumb_small)) unless request.person.profile.image_url.nil?
.name
= request.person.real_name
%h1{:id => 'group_title'}
Relations

View file

@ -13,7 +13,8 @@ $(function() {
$("li .person").draggable({
revert: true
});
$(".group ul").droppable({
drop: function(event, ui) {
if (ui.draggable[0].getAttribute('request_id') != null){
@ -38,6 +39,21 @@ $(function() {
$(this).closest("ul").append(ui.draggable);
}
});
$(".remove ul").droppable({
drop: function(event, ui) {
if (ui.draggable[0].getAttribute('request_id') != null){
$.ajax({
type: "DELETE",
url: "/requests/" + ui.draggable[0].getAttribute('request_id') ,
data: {"accept" : false }
});
alert("Removed Request, proably want an undo countdown.")
ui.draggable[0].fadeOut("slow")
}
}
});
});
$(".group h3").live( 'click', function() {

View file

@ -772,7 +772,8 @@ h1.big_text
.group,
.requests
.requests,
.remove
:list
:style none