diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index f0d614f1c6279f7a58dfb424176fb746ec3d2538..fc99d89d573771ee27e9d063a2f8027c0b39b768 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -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 diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index 5fcb79d022ef4662b608da9569dfd98806e71927..02e3c94d8a90ec1102992b93023edf0177563f8f 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -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