fixes #1825
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
class PostsController < ApplicationController
|
class PostsController < ApplicationController
|
||||||
before_filter :member_only, :except => [:show, :show_seq, :index]
|
before_filter :member_only, :except => [:show, :show_seq, :index, :home]
|
||||||
before_filter :builder_only, :only => [:copy_notes]
|
before_filter :builder_only, :only => [:copy_notes]
|
||||||
after_filter :save_recent_tags, :only => [:update]
|
after_filter :save_recent_tags, :only => [:update]
|
||||||
respond_to :html, :xml, :json
|
respond_to :html, :xml, :json
|
||||||
@@ -93,6 +93,14 @@ class PostsController < ApplicationController
|
|||||||
@error = x
|
@error = x
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def home
|
||||||
|
if CurrentUser.user.is_anonymous?
|
||||||
|
redirect_to intro_explore_posts_path
|
||||||
|
else
|
||||||
|
redirect_to posts_path(:tags => params[:tags])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def tag_query
|
def tag_query
|
||||||
params[:tags] || (params[:post] && params[:post][:tags])
|
params[:tags] || (params[:post] && params[:post][:tags])
|
||||||
|
|||||||
@@ -154,6 +154,9 @@ Danbooru::Application.routes.draw do
|
|||||||
resources :pool_versions, :only => [:index]
|
resources :pool_versions, :only => [:index]
|
||||||
resources :posts do
|
resources :posts do
|
||||||
resources :votes, :controller => "post_votes", :only => [:create, :destroy]
|
resources :votes, :controller => "post_votes", :only => [:create, :destroy]
|
||||||
|
collection do
|
||||||
|
get :home
|
||||||
|
end
|
||||||
member do
|
member do
|
||||||
put :revert
|
put :revert
|
||||||
put :copy_notes
|
put :copy_notes
|
||||||
@@ -352,5 +355,5 @@ Danbooru::Application.routes.draw do
|
|||||||
match "/static/benchmark" => "static#benchmark"
|
match "/static/benchmark" => "static#benchmark"
|
||||||
match "/static/name_change" => "static#name_change", :as => "name_change"
|
match "/static/name_change" => "static#name_change", :as => "name_change"
|
||||||
|
|
||||||
root :to => "explore/posts#intro"
|
root :to => "posts#home"
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user