diaspora/app/controllers/posts_controller.rb
MrZYX 98cdee97c0 Merge branch '619-gender-aware-translations' of https://github.com/siefca/diaspora into inflections
Conflicts:
	Gemfile
	app/controllers/application_controller.rb
	app/controllers/posts_controller.rb
	app/controllers/publics_controller.rb
2011-02-24 00:33:34 +01:00

31 lines
992 B
Ruby

# Copyright (c) 2010, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
class PostsController < ApplicationController
skip_before_filter :set_contacts_notifications_and_status
skip_before_filter :count_requests
skip_before_filter :set_invites
skip_before_filter :set_locale
skip_before_filter :which_action_and_user
skip_before_filter :set_grammatical_gender
def show
@post = Post.where(:id => params[:id], :public => true).includes(:person, :comments => :person).first
if @post
@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
end
end
end