BUGFIX: exclude categories from the top view

This commit is contained in:
Régis Hanol 2014-01-16 00:49:58 +01:00
parent defc450691
commit 462c6d81f5
2 changed files with 6 additions and 8 deletions

View File

@ -84,7 +84,8 @@ class ListController < ApplicationController
def top_lists
discourse_expires_in 1.minute
top = generate_top_lists
options = build_topic_list_options
top = generate_top_lists(options)
respond_to do |format|
format.html do
@ -201,12 +202,9 @@ class ListController < ApplicationController
public_send(method, opts.merge(next_page_params(opts)))
end
def generate_top_lists
def generate_top_lists(options)
top = {}
options = {
per_page: SiteSetting.topics_per_period_in_top_summary,
category: params[:category]
}
options[:per_page] = SiteSetting.topics_per_period_in_top_summary
topic_query = TopicQuery.new(current_user, options)
if current_user.present?

View File

@ -53,7 +53,7 @@ class TopMenuItem
def matches_action?(action_name)
return true if action_name == "index" && name == SiteSetting.homepage
return true if name == action_name
return true if action_name.start_with?(name)
false
end
@ -69,4 +69,4 @@ class TopMenuItem
end
end
end
end
end