copy in manage page by clicking 'add a new friend' for now

This commit is contained in:
danielvincent 2010-10-28 11:28:58 -07:00
parent 6626b00961
commit a0d83e28a1
4 changed files with 11 additions and 5 deletions

View file

@ -47,7 +47,6 @@ class AspectsController < ApplicationController
def show
@aspect = current_user.aspect_by_id params[:id]
@friends_not_in_aspect = current_user.friends_not_in_aspect(@aspect)
unless @aspect
render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404
else
@ -90,7 +89,11 @@ class AspectsController < ApplicationController
flash[:error] = I18n.t 'aspects.add_to_aspect.failure'
end
redirect_to aspect_path(params[:aspect_id])
if params[:manage]
redirect_to aspects_manage_path
else
redirect_to aspect_path(params[:aspect_id])
end
end
def remove_from_aspect

View file

@ -67,6 +67,6 @@
.fancybox_content
%div{:id => "add_request_pane_#{aspect.id}"}
= render "requests/new_request", :aspect => aspect
= render "requests/new_request", :aspect => aspect, :manage => true

View file

@ -8,8 +8,7 @@
=t('.add_a_new_friend_to')
%i= aspect.name
- if @friends_not_in_aspect
= render('shared/add_friend_dropdown', :aspect => aspect, :friends => @friends_not_in_aspect)
= render 'shared/add_friend_dropdown', :aspect => aspect, :friends => current_user.friends_not_in_aspect(aspect), :manage => defined?(manage)
= form_for Request.new do |fr_request|
= fr_request.error_messages
@ -25,6 +24,8 @@
- if defined?(getting_started)
= hidden_field_tag :getting_started, getting_started
- if defined?(manage)
= hidden_field_tag :manage, true
= fr_request.submit

View file

@ -2,4 +2,6 @@
= form_tag '/aspects/add_to_aspect', :id => 'add_to_aspect' do
= select_tag :friend_id, options_from_collection_for_select(friends, "id", "real_name"), :include_blank => true
= hidden_field_tag :aspect_id, aspect.id
- if defined?(manage)
= hidden_field_tag :manage, true
= submit_tag "add to #{aspect.name}"