mirror of
https://github.com/discourse/discourse.git
synced 2026-08-05 10:47:46 -05:00
Include pinned on Categories page
This commit is contained in:
@@ -26,10 +26,11 @@ class CategoryFeaturedTopic < ActiveRecord::Base
|
||||
WHERE ft.category_id = :category_id
|
||||
AND ft.visible
|
||||
AND ft.deleted_at IS NULL
|
||||
AND ft.archetype <> '#{Archetype.private_message}'
|
||||
AND ft.archetype <> :private_message
|
||||
ORDER BY ft.bumped_at DESC
|
||||
LIMIT :featured_limit",
|
||||
category_id: c.id,
|
||||
private_message: Archetype.private_message,
|
||||
featured_limit: SiteSetting.category_featured_topics
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
require_dependency 'pinned_check'
|
||||
|
||||
class CategoryTopicSerializer < ListableTopicSerializer
|
||||
|
||||
attributes :visible, :closed, :archived
|
||||
attributes :visible, :closed, :archived, :pinned
|
||||
has_one :category
|
||||
|
||||
def pinned
|
||||
PinnedCheck.new(object, object.user_data).pinned?
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user