mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
Rename 'popular' to 'latest'. First stab at 'Hot' tab.
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
class ListController < ApplicationController
|
||||
|
||||
before_filter :ensure_logged_in, except: [:index, :category, :category_feed]
|
||||
before_filter :ensure_logged_in, except: [:index, :hot, :category, :category_feed]
|
||||
skip_before_filter :check_xhr
|
||||
|
||||
# Create our filters
|
||||
[:popular, :favorited, :read, :posted, :unread, :new].each do |filter|
|
||||
[:latest, :hot, :favorited, :read, :posted, :unread, :new].each do |filter|
|
||||
define_method(filter) do
|
||||
|
||||
list_opts = {page: params[:page]}
|
||||
@ -14,7 +14,7 @@ class ListController < ApplicationController
|
||||
#TODO objectify this stuff
|
||||
SiteSetting.top_menu.split('|').each do |f|
|
||||
s = f.split(",")
|
||||
if s[0] == action_name || (action_name == "index" && s[0] == "popular")
|
||||
if s[0] == action_name || (action_name == "index" && s[0] == "latest")
|
||||
list_opts[:exclude_category] = s[1][1..-1] if s.length == 2
|
||||
end
|
||||
end
|
||||
@ -27,7 +27,7 @@ class ListController < ApplicationController
|
||||
respond(list)
|
||||
end
|
||||
end
|
||||
alias_method :index, :popular
|
||||
alias_method :index, :latest
|
||||
|
||||
def category
|
||||
|
||||
@ -60,6 +60,12 @@ class ListController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def popular_redirect
|
||||
# We've renamed popular to latest. Use a redirect until we're sure we can
|
||||
# safely remove this.
|
||||
redirect_to latest_path, :status => 301
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def respond(list)
|
||||
|
Reference in New Issue
Block a user