From a8ac403e30f1b086e472221f80569d9368add415 Mon Sep 17 00:00:00 2001 From: zhitomirskiyi Date: Fri, 28 Jan 2011 16:35:04 -0800 Subject: [PATCH] share with action for people who are already on diaspora --- app/controllers/people_controller.rb | 1 + app/views/people/show.html.haml | 3 +++ app/views/services/finder.html.haml | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index a1251934f..824ee9487 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -42,6 +42,7 @@ class PeopleController < ApplicationController def show @person = Person.where(:id => params[:id]).first @post_type = :all + @share_with = (params[:share_with] == 'true') if @person @incoming_request = current_user.request_from(@person) diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index fa6649996..d49146b96 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -28,6 +28,9 @@ :id => @person.id}, :class => 'share_with button', :rel => 'facebox' + - if @share_with + = javascript_tag "$(document).ready(function() {jQuery.facebox({ ajax: '#{share_with_path(:id => @person.id)}' });});" + - else .right diff --git a/app/views/services/finder.html.haml b/app/views/services/finder.html.haml index ab525f701..a0a6ab4aa 100644 --- a/app/views/services/finder.html.haml +++ b/app/views/services/finder.html.haml @@ -32,6 +32,14 @@ = t('invitations.new.already_invited') %br = link_to t('.resend'), service_inviter_path(:uid => uid, :provider => 'facebook', :invitation_id => friend[:invitation_id]) + - elsif friend[:person] + = link_to t('people.show.start_sharing'), + {:controller => "people", + :action => "show", + :id => friend[:person].id, + :share_with => true}, + :class => 'button' + - elsif current_user.invites > 0 = form_tag service_inviter_path do = select_tag(:aspect_id, options_from_collection_for_select(@all_aspects, 'id', 'name'))