mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: add RSS feed for top topics
This commit is contained in:
parent
ff31403a60
commit
01e1bb53f1
@ -129,6 +129,18 @@ class ListController < ApplicationController
|
|||||||
render 'list', formats: [:rss]
|
render 'list', formats: [:rss]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def top_feed
|
||||||
|
discourse_expires_in 1.minute
|
||||||
|
|
||||||
|
@title = "#{SiteSetting.title} - #{I18n.t("rss_description.top")}"
|
||||||
|
@link = "#{Discourse.base_url}/top"
|
||||||
|
@atom_link = "#{Discourse.base_url}/top.rss"
|
||||||
|
@description = I18n.t("rss_description.top")
|
||||||
|
@topic_list = TopicQuery.new(nil).list_top_for("monthly")
|
||||||
|
|
||||||
|
render 'list', formats: [:rss]
|
||||||
|
end
|
||||||
|
|
||||||
def category_feed
|
def category_feed
|
||||||
guardian.ensure_can_see!(@category)
|
guardian.ensure_can_see!(@category)
|
||||||
discourse_expires_in 1.minute
|
discourse_expires_in 1.minute
|
||||||
@ -175,6 +187,7 @@ class ListController < ApplicationController
|
|||||||
list.for_period = period
|
list.for_period = period
|
||||||
list.more_topics_url = construct_url_with(:next, top_options)
|
list.more_topics_url = construct_url_with(:next, top_options)
|
||||||
list.prev_topics_url = construct_url_with(:prev, top_options)
|
list.prev_topics_url = construct_url_with(:prev, top_options)
|
||||||
|
@rss = "top"
|
||||||
|
|
||||||
if use_crawler_layout?
|
if use_crawler_layout?
|
||||||
@title = I18n.t("js.filters.top.#{period}.title")
|
@title = I18n.t("js.filters.top.#{period}.title")
|
||||||
|
@ -201,6 +201,7 @@ en:
|
|||||||
rss_description:
|
rss_description:
|
||||||
latest: "Latest topics"
|
latest: "Latest topics"
|
||||||
hot: "Hot topics"
|
hot: "Hot topics"
|
||||||
|
top: "Top topics"
|
||||||
posts: "Latest posts"
|
posts: "Latest posts"
|
||||||
too_late_to_edit: "That post was created too long ago. It can no longer be edited or deleted."
|
too_late_to_edit: "That post was created too long ago. It can no longer be edited or deleted."
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user