diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 7bc9c9584..b260095f2 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -31,7 +31,7 @@ class AspectsController < ApplicationController def create @aspect = current_user.aspect params[:aspect] flash[:notice] = "Click on the plus on the left side to tell Diaspora who can see your new aspect." - respond_with @aspect + respond_with :location => edit_aspect_path(@aspect) end def new diff --git a/app/views/aspects/edit.html.haml b/app/views/aspects/edit.html.haml index aef241111..70687b326 100644 --- a/app/views/aspects/edit.html.haml +++ b/app/views/aspects/edit.html.haml @@ -22,10 +22,10 @@ = javascript_include_tag 'aspect-edit.js' - content_for :left_pane do - %h1 + %h3 Requests - %li.requests + .requests %ul - for request in @remote_requests %li.requested_person{:id => request.person.id, :request_id => request.id} @@ -39,18 +39,16 @@ %li.remove %ul - -%h1{:id => 'aspect_title'} - Aspects - %ul#aspect_list + .new_aspect= link_to("add a new aspect", "#add_aspect_pane", :id => "add_aspect_button", :title => "Add a new relation") - for aspect in @aspects - + %li.aspect - %h3{:contenteditable => true}= aspect.name - + %h1{:contenteditable => true}= aspect.name + %ul{:id => aspect.id} + -if aspect.people.size < 1 %li.grey Drag to add people @@ -61,6 +59,11 @@ = person_image_tag(person) .name = person.real_name + = link_to (image_tag('add_friend_button.png', :height => "50px", :width => "50px")), "#add_request_pane_#{aspect.id}", :class => 'add_request_button' + .yo{:style => 'display:none'} + %div{:id => "add_request_pane_#{aspect.id}"} + = render "requests/new_request", :aspect => aspect + %p %br = link_to 'Update Aspects', '#', :class => 'button', :id => "move_friends_link" diff --git a/app/views/requests/_new_request.haml b/app/views/requests/_new_request.haml index c9aed0c49..27e4f05f4 100644 --- a/app/views/requests/_new_request.haml +++ b/app/views/requests/_new_request.haml @@ -19,7 +19,7 @@ %h1 Add a new friend to - %i= @aspect.name + %i= aspect.name = form_for Request.new do |f| = f.error_messages @@ -31,6 +31,6 @@ %p = f.label :destination_url, "Friend's username" = f.text_field :destination_url - = f.hidden_field :aspect_id, :value => @aspect.id + = f.hidden_field :aspect_id, :value => aspect.id = f.submit diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index f0ebafa14..137fea38d 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -24,6 +24,4 @@ - unless @aspect == :all = link_to (image_tag('add_friend_button.png', :height => "50px", :width => "50px")), "#add_request_pane", :id => 'add_request_button' - .yo{:style => 'display:none'} - #add_request_pane - = render "requests/new_request" + diff --git a/public/javascripts/aspect-edit.js b/public/javascripts/aspect-edit.js index 872549b0c..18eafd34b 100644 --- a/public/javascripts/aspect-edit.js +++ b/public/javascripts/aspect-edit.js @@ -29,11 +29,11 @@ $('#move_friends_link').live( 'click', function(){ }); $(function() { - $("li .person").draggable({ + $("ul .person").draggable({ revert: true }); - $("li .requested_person").draggable({ + $("ul .requested_person").draggable({ revert: true }); @@ -59,8 +59,8 @@ $(function() { $('#aspect_list').data( ui.draggable[0].id, move); ui.draggable.css('background-color','orange'); } - $(this).closest("ul").append(ui.draggable); } + $(this).closest("ul").append(ui.draggable); } }); diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 0c0ed1a4e..ed2970c8d 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -37,6 +37,7 @@ $(document).ready(function(){ //buttons////// $("#add_aspect_button").fancybox({ 'titleShow' : false }); $("#add_request_button").fancybox({ 'titleShow': false }); + $(".add_request_button").fancybox({ 'titleShow': false }); $("input[type='submit']").addClass("button");