mirror of
https://github.com/discourse/discourse.git
synced 2025-09-10 08:17:55 +08:00
UX: Display group topics in a topic list.
This commit is contained in:
parent
d3f5b4e4b0
commit
a35227918f
12 changed files with 269 additions and 18 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue