diff --git a/app/views/groups/edit.html.haml b/app/views/groups/edit.html.haml index b8fe6e904629655e5f3d3295ca6eb3b4053d9ab9..c9ec739511fd4d14f23b3557ffe3291ca2242ef4 100644 --- a/app/views/groups/edit.html.haml +++ b/app/views/groups/edit.html.haml @@ -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 diff --git a/public/javascripts/group-edit.js b/public/javascripts/group-edit.js index e5c995bed8f4d87ef5d458c69afd6915f871abf2..fa23cf5667a3bf83752d2a6e66b393723b9b0800 100644 --- a/public/javascripts/group-edit.js +++ b/public/javascripts/group-edit.js @@ -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() { diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 5cf70a6bde499fa782215548ebab618f57a6ba58..3f2e841a9d28cc59ff850d979f59dd84b47a34a7 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -772,7 +772,8 @@ h1.big_text .group, -.requests +.requests, +.remove :list :style none