fixed issue with photos#index not recognizing an already sent request.
This commit is contained in:
parent
9bb44e6cac
commit
d7609ef647
4 changed files with 5 additions and 5 deletions
|
|
@ -36,8 +36,6 @@ class PeopleController < ApplicationController
|
||||||
|
|
||||||
if @contact
|
if @contact
|
||||||
@aspects_with_person = @contact.aspects
|
@aspects_with_person = @contact.aspects
|
||||||
else
|
|
||||||
@pending_request = current_user.request_for(@person)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@posts = current_user.visible_posts(:person_id => @person.id, :_type => "StatusMessage").paginate :page => params[:page], :order => 'created_at DESC'
|
@posts = current_user.visible_posts(:person_id => @person.id, :_type => "StatusMessage").paginate :page => params[:page], :order => 'created_at DESC'
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,6 @@ class PhotosController < ApplicationController
|
||||||
|
|
||||||
if @contact
|
if @contact
|
||||||
@aspects_with_person = @contact.aspects
|
@aspects_with_person = @contact.aspects
|
||||||
else
|
|
||||||
@pending_request = current_user.pending_requests.find_by_person_id(@person.id)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@posts = current_user.raw_visible_posts.all(:_type => 'Photo', :person_id => @person.id, :order => 'created_at DESC').paginate :page => params[:page], :order => 'created_at DESC'
|
@posts = current_user.raw_visible_posts.all(:_type => 'Photo', :person_id => @person.id, :order => 'created_at DESC').paginate :page => params[:page], :order => 'created_at DESC'
|
||||||
|
|
|
||||||
|
|
@ -28,4 +28,8 @@ module PeopleHelper
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def pending_request_for(person)
|
||||||
|
current_user.request_for(person)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
%h3
|
%h3
|
||||||
= t('.not_connected', :name => @person.real_name)
|
= t('.not_connected', :name => @person.real_name)
|
||||||
|
|
||||||
- unless @pending_request
|
- unless pending_request_for(@person)
|
||||||
%h3
|
%h3
|
||||||
.description
|
.description
|
||||||
= t('.request_people')
|
= t('.request_people')
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue