Merge branch 'master' of github.com:diaspora/diaspora
This commit is contained in:
commit
c0d10ef174
6 changed files with 24 additions and 5 deletions
|
|
@ -36,7 +36,7 @@ class PeopleController < ApplicationController
|
||||||
if @contact
|
if @contact
|
||||||
@aspects_with_person = @contact.aspects
|
@aspects_with_person = @contact.aspects
|
||||||
else
|
else
|
||||||
@pending_request = current_user.pending_requests.find_by_person_id(@person.id)
|
@pending_request = current_user.request_for(@person)
|
||||||
end
|
end
|
||||||
|
|
||||||
@posts = current_user.visible_posts(:person_id => @person.id).paginate :page => params[:page], :order => 'created_at DESC'
|
@posts = current_user.visible_posts(:person_id => @person.id).paginate :page => params[:page], :order => 'created_at DESC'
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
= t('.thats_you')
|
= t('.thats_you')
|
||||||
- elsif current_user.person_objects.include?(person)
|
- elsif current_user.person_objects.include?(person)
|
||||||
= t('.already_connected')
|
= t('.already_connected')
|
||||||
- elsif current_user.pending_requests.find_by_person_id(person.id)
|
- elsif current_user.request_for(person)
|
||||||
= link_to =t('.pending_request'), aspects_manage_path
|
= link_to =t('.pending_request'), aspects_manage_path
|
||||||
- else
|
- else
|
||||||
- single_aspect_form ||= nil
|
- single_aspect_form ||= nil
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
= image_tag("social_media_logos/feed-16x16.png")
|
= image_tag("social_media_logos/feed-16x16.png")
|
||||||
- if current_user.services
|
- if current_user.services
|
||||||
- for service in current_user.services
|
- for service in current_user.services
|
||||||
= image_tag("social_media_logos/#{service.provider}-24x24.png")
|
= image_tag("social_media_logos/#{service.provider}-16x16.png")
|
||||||
|
|
||||||
|
|
||||||
= link_to '(?)', "#question_mark_pane", :class => 'question_mark', :style=>"display:none;"
|
= link_to '(?)', "#question_mark_pane", :class => 'question_mark', :style=>"display:none;"
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,6 @@ SOCKET_PORT=8080
|
||||||
# See thin -h for possible values.
|
# See thin -h for possible values.
|
||||||
DEFAULT_THIN_ARGS="-p $THIN_PORT"
|
DEFAULT_THIN_ARGS="-p $THIN_PORT"
|
||||||
|
|
||||||
# Uncomment to run in production mode.
|
# Uncomment to run in production/test mode.
|
||||||
#export RAILS_ENV="production rails server"
|
# DEFAULT_THIN_ARGs="$DEFAULT_THIN_ARGS -e production"
|
||||||
|
# DEFAULT_THIN_ARGs="$DEFAULT_THIN_ARGS -e test"
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,9 @@ module Diaspora
|
||||||
self.aspects.all.collect{|x| x.id}
|
self.aspects.all.collect{|x| x.id}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def request_for(to_person)
|
||||||
|
Request.first(:from_id => self.person.id, :to_id => to_person.id).first
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -173,4 +173,19 @@ describe User do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "#request_for" do
|
||||||
|
let!(:user5) {make_user}
|
||||||
|
|
||||||
|
it 'should not have a pending request before connecting' do
|
||||||
|
request = user.request_for(user5.person)
|
||||||
|
request.should be_nil
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should have a pending request after sending a request' do
|
||||||
|
user.send_contact_request_to(user5.person, user.aspects.first)
|
||||||
|
request = user.reload.request_for(user5.person)
|
||||||
|
request.should_not be_nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue