Rename 'popular' to 'latest'. First stab at 'Hot' tab.

This commit is contained in:
Robin Ward
2013-03-27 16:17:49 -04:00
parent d1945057fd
commit 36269cfbaa
52 changed files with 946 additions and 323 deletions

View File

@ -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)