add profile streams to backbone. this breaks hovercards, atm.

This commit is contained in:
danielgrippi 2011-11-29 14:41:46 -08:00 committed by Dennis Collinson
parent 42ce3b277b
commit aa7343d759
2 changed files with 11 additions and 8 deletions

View file

@ -84,6 +84,8 @@ class PeopleController < ApplicationController
end
def show
@backbone = true
@person = Person.find_from_id_or_username(params)
if remote_profile_with_no_user_session?
@ -124,13 +126,13 @@ class PeopleController < ApplicationController
end
if params[:only_posts]
render :partial => 'shared/stream', :locals => {:posts => @stream.stream_posts}
respond_to do |format|
format.html{ render :partial => 'shared/stream', :locals => {:posts => @stream.stream_posts} }
end
else
respond_to do |format|
format.all { respond_with @person, :locals => {:post_type => :all} }
format.json {
render :json => @person.to_json(:includes => params[:includes])
}
format.json{ render :json => @stream.stream_posts.to_json(:include => {:author => {:include => :profile}}) }
end
end
end

View file

@ -27,14 +27,15 @@
= render 'people/sub_header', :person => @person, :contact => @contact
/ hackity hack until we get a photo stream
- if (@posts && @posts.length > 0) || (@stream && @stream.stream_posts.length > 0)
- if @backbone && (@posts && @posts.length > 0) || (@stream && @stream.stream_posts.length > 0)
-if @post_type == :photos
= render 'photos/index', :photos => @posts
- else
#main_stream.stream
= render 'shared/stream', :posts => @stream.stream_posts
#pagination
=link_to(t('more'), next_page_path, :class => 'paginate')
- if !@backbone
= render 'shared/stream', :posts => @stream.stream_posts
#pagination
=link_to(t('more'), next_page_path, :class => 'paginate')
- else
#main_stream