diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 32b71971f..e6f6f876d 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -10,9 +10,17 @@ class PostsController < ApplicationController def show @post = Post.first(:id => params[:id], :public => true) - @landing_page = true + if @post - render "posts/#{@post.class.to_s.underscore}", :layout => true + @landing_page = true + @person = @post.person + if @person.owner_id + I18n.locale = @person.owner.language + render "posts/#{@post.class.to_s.underscore}", :layout => true + else + flash[:error] = "that post does not exsist!" + redirect_to root_url + end else flash[:error] = "that post does not exsist!" redirect_to root_url diff --git a/app/views/posts/photo.html.haml b/app/views/posts/photo.html.haml index bcd846459..1384b80b4 100644 --- a/app/views/posts/photo.html.haml +++ b/app/views/posts/photo.html.haml @@ -6,10 +6,10 @@ = include_javascripts :photos #author_info - = person_image_link(@post.person) + = person_image_link(@person) .from %h2 - = @post.person.name + = @person.name .span-14.append-1.last #show_photo{:data=>{:guid=>@post.id}} = image_tag @post.url(:scaled_full) diff --git a/app/views/posts/status_message.haml b/app/views/posts/status_message.haml index bae8db98e..c57087f43 100644 --- a/app/views/posts/status_message.haml +++ b/app/views/posts/status_message.haml @@ -3,10 +3,10 @@ -# the COPYRIGHT file. #author_info - = person_image_link(@post.person) + = person_image_link(@person) .from %h2 - = @post.person.name + = @person.name .span-14.append-1.last #show_text