Pull relationship action button from search results out into a partial.
Copyedit messages.
This commit is contained in:
parent
b0ca6ead26
commit
c1bf68068f
4 changed files with 27 additions and 43 deletions
|
|
@ -4,26 +4,8 @@
|
||||||
|
|
||||||
.stream_element{:id => person.id}
|
.stream_element{:id => person.id}
|
||||||
.right
|
.right
|
||||||
- if person.owner_id == current_user.id
|
= render :partial => 'people/relationship_action',
|
||||||
= t('.thats_you')
|
:locals => { :person => person, :contact => contact, :request => request}
|
||||||
- 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'
|
|
||||||
|
|
||||||
= person_image_link(person)
|
= person_image_link(person)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,27 +5,9 @@
|
||||||
.stream_element{:id => person.id}
|
.stream_element{:id => person.id}
|
||||||
|
|
||||||
.right{:style=>"display:inline;"}
|
.right{:style=>"display:inline;"}
|
||||||
- if person.owner_id == current_user.id
|
= render :partial => 'people/relationship_action',
|
||||||
= t('.thats_you')
|
:locals => { :person => person, :contact => contact, :request => request}
|
||||||
- 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'
|
|
||||||
|
|
||||||
= person_image_link(person)
|
= person_image_link(person)
|
||||||
|
|
||||||
.content
|
.content
|
||||||
|
|
|
||||||
20
app/views/people/_relationship_action.haml
Normal file
20
app/views/people/_relationship_action.haml
Normal file
|
|
@ -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'
|
||||||
|
|
@ -326,9 +326,9 @@ en:
|
||||||
many: "%{count} people"
|
many: "%{count} people"
|
||||||
other: "%{count} people"
|
other: "%{count} people"
|
||||||
person:
|
person:
|
||||||
pending_request: "pending request"
|
pending_request: "Pending request"
|
||||||
already_connected: "Already connected"
|
already_connected: "Already connected"
|
||||||
thats_you: "thats you!"
|
thats_you: "That's you!"
|
||||||
add_contact: "add contact"
|
add_contact: "add contact"
|
||||||
index:
|
index:
|
||||||
results_for: "search results for"
|
results_for: "search results for"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue