diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index eed337571..5d219d8bc 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -4,12 +4,12 @@ class CommentsController < ApplicationController rescue_from User::PrivilegeError, :with => "static/access_denied" def index - if params[:group_by] == "post" - index_by_post + if params[:group_by] == "comment" + index_by_comment elsif request.format == Mime::JS index_for_post else - index_by_comment + index_by_post end end diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index 9e7280bd8..7f70bf4ab 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -8,10 +8,10 @@ class NotesController < ApplicationController end def index - if params[:group_by] == "post" - index_by_post - else + if params[:group_by] == "note" index_by_note + else + index_by_post end end diff --git a/config/routes.rb b/config/routes.rb index 6c3170856..3010b0e22 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -173,10 +173,64 @@ Danbooru::Application.routes.draw do resources :ftopics, :controller => "forum_topics" resources :fposts, :controller => "forum_posts" + # legacy aliases + match "/artist" => "artists#index" + match "/artist/index" => "artists#index" + match "/artist/show/:id" => "artists#show" + match "/artist/history/:id" => "artist_versions#index" + + match "/comment" => "comments#index" + match "/comment/index" => "comments#index" + match "/comment/show/:id" => "comments#show" + + match "/favorite" => "favorites#index" + match "/favorite/index" => "favorites#index" + + match "/forum" => "forum_topics#index" + match "/forum/index" => "forum_topics#index" + match "/forum/show/:id" => "forum_posts#show" + + match "/note" => "notes#index" + match "/note/index" => "notes#index" + match "/note/history" => "note_versions#index" + + match "/pool" => "pools#index" + match "/pool/index" => "pools#index" + match "/pool/show/:id" => "pools#show" + match "/pool/history/:id" => "pool_versions#index" + match "/pool/recent_changes" => "pool_versions#index" + + match "/post/index" => "posts#index" + match "/post" => "posts#index" + match "/post/upload" => "uploads#new" + match "/post/moderate" => "moderator/post/queues#show" + match "/post/atom" => "posts#index.atom" + match "/post/atom.feed" => "posts#index.atom" + match "/post/popular_by_day" => "explore/posts#popular" + match "/post/popular_by_week" => "explore/posts#popular" + match "/post/popular_by_month" => "explore/posts#popular" + match "/post/show/:id/:tag_title" => "posts#show" + match "/post/show/:id" => "posts#show" + + match "/post_tag_history" => "post_versions#index" + match "/post_tag_history/index" => "post_versions#index" + + match "/tag" => "tags#index" + match "/tag/index" => "tags#index" + + match "/user" => "users#index" + match "/user/index" => "users#index" + + match "/wiki" => "wiki_pages#index" + match "/wiki/index" => "wiki_pages#index" + match "/wiki/show/:title" => "wiki_pages#index" + match "/wiki/recent_changes" => "wiki_page_versions#index" + match "/wiki/history/:title" => "wiki_page_versions#index" + match "/static/keyboard_shortcuts" => "static#keyboard_shortcuts", :as => "keyboard_shortcuts" match "/static/bookmarklet" => "static#bookmarklet", :as => "bookmarklet" match "/static/site_map" => "static#site_map", :as => "site_map" match "/static/terms_of_service" => "static#terms_of_service", :as => "terms_of_service" - root :to => "landings#show" + root :to => "posts#index" end