Merge pull request #4243 from davexunit/feature/2948
Show the user if a contact is sharing with them when viewing their profile page
This commit is contained in:
commit
30dff802d5
6 changed files with 45 additions and 1 deletions
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
## Features
|
||||
* Admin: add option to find users under 13 (COPPA) [#4252](https://github.com/diaspora/diaspora/pull/4252)
|
||||
* Show the user if a contact is sharing with them when viewing their profile page [#2948](https://github.com/diaspora/diaspora/issues/2948)
|
||||
|
||||
# 0.1.1.0
|
||||
|
||||
|
|
|
|||
|
|
@ -622,6 +622,17 @@ form.new_comment
|
|||
h4
|
||||
:font-weight bold
|
||||
|
||||
#sharing_message
|
||||
:font-size smaller
|
||||
:align middle
|
||||
|
||||
span
|
||||
:vertical-align middle
|
||||
|
||||
img
|
||||
:vertical-align middle
|
||||
:margin 0.5em
|
||||
|
||||
#photo_container
|
||||
:text
|
||||
:align center
|
||||
|
|
|
|||
|
|
@ -87,4 +87,13 @@ module PeopleHelper
|
|||
return Rails.application.routes.url_helpers.person_path(person, opts)
|
||||
end
|
||||
end
|
||||
|
||||
def sharing_message(person, contact)
|
||||
if contact.sharing?
|
||||
content_tag(:div, :id => 'sharing_message') do
|
||||
image_tag('icons/check_yes_ok.png') +
|
||||
content_tag(:span, I18n.t('people.helper.is_sharing', :name => person.name))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
- if user_signed_in?
|
||||
- if person != current_user.person
|
||||
= sharing_message(@person, @contact)
|
||||
|
||||
- if @contact && @contact.receiving?
|
||||
%br
|
||||
= link_to t('people.show.mention'), new_status_message_path(:person_id => @person.id), :class => 'button', :rel => 'facebox'
|
||||
|
|
|
|||
|
|
@ -594,6 +594,7 @@ en:
|
|||
helper:
|
||||
results_for: " results for %{params}"
|
||||
people_on_pod_are_aware_of: " people on pod are aware of"
|
||||
is_sharing: "%{name} is sharing with you"
|
||||
aspect_list:
|
||||
edit_membership: "edit aspect membership"
|
||||
add_contact_small:
|
||||
|
|
|
|||
|
|
@ -117,5 +117,25 @@ describe PeopleHelper do
|
|||
local_or_remote_person_path(@person).should == person_path(@person)
|
||||
end
|
||||
end
|
||||
|
||||
describe '#sharing_message' do
|
||||
before do
|
||||
@contact = FactoryGirl.create(:contact, :person => @person)
|
||||
end
|
||||
|
||||
context 'when the contact is sharing' do
|
||||
it 'shows the sharing message' do
|
||||
message = I18n.t('people.helper.is_sharing', :name => @person.name)
|
||||
@contact.stub(:sharing?).and_return(true)
|
||||
sharing_message(@person, @contact).should include(message)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the contact is not sharing' do
|
||||
it 'does not show the sharing message' do
|
||||
@contact.stub(:sharing?).and_return(false)
|
||||
sharing_message(@person, @contact).should be_blank
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue