FEATURE: optional top level bookmarks tab

This commit is contained in:
Sam 2015-01-25 15:53:11 +11:00
parent 7d07ad4aa4
commit ba186b25a7
5 changed files with 11 additions and 2 deletions

View File

@ -819,6 +819,7 @@ en:
posted: "You haven't posted in any topics yet."
latest: "There are no latest topics. That's sad."
hot: "There are no hot topics."
bookmarks: "You have no bookmarked topics yet."
category: "There are no {{category}} topics."
top: "There are no top topics."
educate:
@ -1465,6 +1466,9 @@ en:
posted:
title: "My Posts"
help: "topics you have posted in"
bookmarks:
title: "Bookmarks"
help: "topics you have bookmarked"
category:
title:
zero: "{{categoryName}}"

View File

@ -740,7 +740,7 @@ en:
enable_noscript_support: "Enable standard webcrawler search engine support via the noscript tag"
allow_moderators_to_create_categories: "Allow moderators to create new categories"
cors_origins: "Allowed origins for cross-origin requests (CORS). Each origin must include http:// or https://. The DISCOURSE_ENABLE_CORS env variable must be set to true to enable CORS."
top_menu: "Determine which items appear in the homepage navigation, and in what order. Example latest|new|unread|starred|categories|top|read|posted"
top_menu: "Determine which items appear in the homepage navigation, and in what order. Example latest|new|unread|categories|top|read|posted|bookmarks"
post_menu: "Determine which items appear on the post menu, and in what order. Example like|edit|flag|delete|share|bookmark|reply"
post_menu_hidden_items: "The menu items to hide by default in the post menu unless an expansion ellipsis is clicked on."
share_links: "Determine which items appear on the share dialog, and in what order."

View File

@ -92,6 +92,7 @@ basic:
- categories
- read
- posted
- bookmarks
post_menu:
client: true
type: list

View File

@ -56,7 +56,7 @@ module Discourse
class CSRF < Exception; end
def self.filters
@filters ||= [:latest, :unread, :new, :read, :posted]
@filters ||= [:latest, :unread, :new, :read, :posted, :bookmarks]
end
def self.feed_filters

View File

@ -88,6 +88,10 @@ class TopicQuery
create_list(:posted) {|l| l.where('tu.posted') }
end
def list_bookmarks
create_list(:bookmarks) {|l| l.where('tu.bookmarked') }
end
def list_top_for(period)
score = "#{period}_score"
create_list(:top, unordered: true) do |topics|