mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
UX: Display group topics in a topic list.
This commit is contained in:
@ -50,6 +50,7 @@ class ListController < ApplicationController
|
||||
TopTopic.periods.map { |p| :"category_top_#{p}" },
|
||||
TopTopic.periods.map { |p| :"category_none_top_#{p}" },
|
||||
TopTopic.periods.map { |p| :"parent_category_category_top_#{p}" },
|
||||
:group_topics
|
||||
].flatten
|
||||
|
||||
# Create our filters
|
||||
@ -131,6 +132,18 @@ class ListController < ApplicationController
|
||||
respond_with_list(list)
|
||||
end
|
||||
|
||||
def group_topics
|
||||
group = Group.find_by(name: params[:group_name])
|
||||
raise Discourse::NotFound unless group
|
||||
guardian.ensure_can_see_group!(group)
|
||||
|
||||
list_opts = build_topic_list_options
|
||||
list = generate_list_for("group_topics", group, list_opts)
|
||||
list.more_topics_url = url_for(construct_url_with(:next, list_opts))
|
||||
list.prev_topics_url = url_for(construct_url_with(:prev, list_opts))
|
||||
respond_with_list(list)
|
||||
end
|
||||
|
||||
def self.generate_message_route(action)
|
||||
define_method("#{action}") do
|
||||
list_opts = build_topic_list_options
|
||||
|
Reference in New Issue
Block a user