diff --git a/app/views/people/_person.html.haml b/app/views/people/_person.html.haml index 4e8df4e57..2dc6038f3 100644 --- a/app/views/people/_person.html.haml +++ b/app/views/people/_person.html.haml @@ -4,26 +4,8 @@ .stream_element{:id => person.id} .right - - if person.owner_id == current_user.id - = t('.thats_you') - - elsif contact && !contact.pending - = t('.already_connected') - - elsif (contact && contact.pending) || (request && request.recipient == person) - = t('.pending_request') - - elsif request && request.sender == person - = link_to t('people.show.incoming_request', :name => truncate(person.name, :length => 20, :separator => ' ', :omission => '')), - {:controller => "contacts", - :action => "new", - :person_id => person.id}, - :class => 'share_with button', - :rel => 'facebox' - - else - = link_to t('people.show.start_sharing'), - {:controller => "contacts", - :action => "new", - :person_id => person.id}, - :class => 'button', - :rel => 'facebox' + = render :partial => 'people/relationship_action', + :locals => { :person => person, :contact => contact, :request => request} = person_image_link(person) diff --git a/app/views/people/_person.mobile.haml b/app/views/people/_person.mobile.haml index 45b9f0326..4982b4542 100644 --- a/app/views/people/_person.mobile.haml +++ b/app/views/people/_person.mobile.haml @@ -5,27 +5,9 @@ .stream_element{:id => person.id} .right{:style=>"display:inline;"} - - if person.owner_id == current_user.id - = t('.thats_you') - - elsif contact && !contact.pending - = t('.already_connected') - - elsif (contact && contact.pending) || (request && request.recipient == person) - = t('.pending_request') - - elsif request && request.sender == person - = link_to t('people.show.incoming_request', :name => truncate(person.name, :length => 20, :separator => ' ', :omission => '')), - {:controller => "contacts", - :action => "new", - :person_id => person.id}, - :class => 'share_with button', - :rel => 'facebox' - - else - = link_to t('people.show.start_sharing'), - {:controller => "contacts", - :action => "new", - :id => person.id}, - :class => 'button', - :rel => 'facebox' - + = render :partial => 'people/relationship_action', + :locals => { :person => person, :contact => contact, :request => request} + = person_image_link(person) .content diff --git a/app/views/people/_relationship_action.haml b/app/views/people/_relationship_action.haml new file mode 100644 index 000000000..ea1fb3209 --- /dev/null +++ b/app/views/people/_relationship_action.haml @@ -0,0 +1,20 @@ +- if person.owner_id == current_user.id + = t('people.person.thats_you') +- elsif contact && !contact.pending + = t('people.person.already_connected') +- elsif (contact && contact.pending) || (request && request.recipient == person) + = t('people.person.pending_request') +- elsif request && request.sender == person + = link_to t('people.show.incoming_request', :name => truncate(person.name, :length => 20, :separator => ' ', :omission => '')), + {:controller => "contacts", + :action => "new", + :person_id => person.id}, + :class => 'share_with button', + :rel => 'facebox' +- else + = link_to t('people.show.start_sharing'), + {:controller => "contacts", + :action => "new", + :person_id => person.id}, + :class => 'button', + :rel => 'facebox' diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index e8544e406..4dc2743b7 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -326,9 +326,9 @@ en: many: "%{count} people" other: "%{count} people" person: - pending_request: "pending request" + pending_request: "Pending request" already_connected: "Already connected" - thats_you: "thats you!" + thats_you: "That's you!" add_contact: "add contact" index: results_for: "search results for"