From c56eaadfa06daa7378f025341e24ca3df39a2347 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 31 Jan 2011 15:47:01 -0800 Subject: [PATCH] Make person profile a little bit aware of an incoming request --- app/views/people/show.html.haml | 31 ++++++++++++++----------------- app/views/people/show.mobile.haml | 2 +- config/locales/diaspora/en.yml | 2 +- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index effc27f83..db17280af 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -22,12 +22,20 @@ #author_info - unless @contact || current_user.person == @person .right - = link_to t('.start_sharing'), - {:controller => "people", - :action => "share_with", - :id => @person.id}, - :class => 'share_with button', - :rel => 'facebox' + - if @incoming_request + = link_to t('.incoming_request', :name => truncate(@person.name, :length => 20, :separator => ' ', :omission => '')), + {:controller => "people", + :action => "share_with", + :id => @person.id}, + :class => 'share_with button', + :rel => 'facebox' + -else + = link_to t('.start_sharing'), + {:controller => "people", + :action => "share_with", + :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)}' });});" @@ -45,17 +53,6 @@ = @person.diaspora_handle %hr - - unless @contact || current_user.person == @person - - if @incoming_request - .floating - %h3 - = link_to t('.incoming_request'), - {:controller => "people", - :action => "share_with", - :id => @person.id}, - :class => 'share_with button', - :rel => 'facebox' - - if @posts.count > 0 -if @post_type == :photos = render 'photos/index', :photos => @posts diff --git a/app/views/people/show.mobile.haml b/app/views/people/show.mobile.haml index b2c228855..da757958b 100644 --- a/app/views/people/show.mobile.haml +++ b/app/views/people/show.mobile.haml @@ -28,7 +28,7 @@ - if @incoming_request .floating %h3 - = t('.incoming_request') + = t('.incoming_request', :name => @person.name) %h4 = link_to t('.return_to_aspects'), aspects_manage_path = t('.to_accept_or_ignore') diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 8fe40bcf2..e2d361fc2 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -365,7 +365,7 @@ en: fail: "Sorry, we couldn't find %{handle}." show: no_posts: "no posts to display!" - incoming_request: "You have an incoming request from this person." + incoming_request: "%{name} wants to share with you" return_to_aspects: "Return to your aspects page" to_accept_or_ignore: "to accept or ignore it." does_not_exist: "Person does not exist!"