From 15651a7bb6a2bf2b7eed54ac83a7d2e45314c719 Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 13 Sep 2010 18:10:07 -0700 Subject: IZ MS group manage page can now add friends to groups --- app/controllers/aspects_controller.rb | 2 +- app/views/aspects/edit.html.haml | 21 ++++++++++++--------- app/views/requests/_new_request.haml | 4 ++-- app/views/shared/_aspect_friends.haml | 4 +--- 4 files changed, 16 insertions(+), 15 deletions(-) (limited to 'app') 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" + -- cgit v1.2.3