mirror of
https://github.com/discourse/discourse.git
synced 2025-03-22 11:59:18 +08:00
BUGFIX: exclude categories from the top view
This commit is contained in:
parent
defc450691
commit
462c6d81f5
@ -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?
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user