35 lines
933 B
Ruby
35 lines
933 B
Ruby
# Copyright (c) 2010, Diaspora Inc. This file is
|
|
# licensed under the Affero General Public License version 3 or later. See
|
|
# the COPYRIGHT file.
|
|
|
|
module PeopleHelper
|
|
|
|
def request_partial single_aspect_form
|
|
if single_aspect_form
|
|
'requests/new_request_with_aspect_to_person'
|
|
else
|
|
'requests/new_request_to_person'
|
|
end
|
|
end
|
|
|
|
def search_or_index
|
|
if params[:q]
|
|
I18n.t 'people.helper.results_for',:params => params[:q]
|
|
else
|
|
I18n.t "people.helper.people_on_pod_are_aware_of"
|
|
end
|
|
end
|
|
|
|
def action_link(person, is_contact)
|
|
if is_contact
|
|
link_to t('people.profile_sidebar.remove_contact'), person, :confirm => t('are_you_sure'), :method => :delete
|
|
elsif person == current_user.person
|
|
link_to t('people.profile_sidebar.edit_my_profile'), edit_person_path(person)
|
|
end
|
|
end
|
|
|
|
def pending_request_for(person)
|
|
current_user.request_for(person)
|
|
end
|
|
|
|
end
|