make the public page show the public profile if html request
This commit is contained in:
parent
70d1c31733
commit
3ba7ce41f1
1 changed files with 8 additions and 2 deletions
|
|
@ -77,8 +77,14 @@ class UsersController < ApplicationController
|
||||||
posts = StatusMessage.where(:author_id => user.person.id, :public => true).order('created_at DESC')
|
posts = StatusMessage.where(:author_id => user.person.id, :public => true).order('created_at DESC')
|
||||||
director = Diaspora::Director.new
|
director = Diaspora::Director.new
|
||||||
ostatus_builder = Diaspora::OstatusBuilder.new(user, posts)
|
ostatus_builder = Diaspora::OstatusBuilder.new(user, posts)
|
||||||
|
respond_to do |format|
|
||||||
|
format.atom{
|
||||||
render :xml => director.build(ostatus_builder), :content_type => 'application/atom+xml'
|
render :xml => director.build(ostatus_builder), :content_type => 'application/atom+xml'
|
||||||
|
}
|
||||||
|
format.html{
|
||||||
|
redirect_to person_path(user.person.id)
|
||||||
|
}
|
||||||
|
end
|
||||||
else
|
else
|
||||||
redirect_to root_url, :error => I18n.t('users.public.does_not_exist', :username => params[:username])
|
redirect_to root_url, :error => I18n.t('users.public.does_not_exist', :username => params[:username])
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue