mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: education panel on pinning at bottom of topics
This commit is contained in:
@@ -32,6 +32,7 @@ class TopicViewSerializer < ApplicationSerializer
|
||||
:starred,
|
||||
:posted,
|
||||
:unpinned,
|
||||
:pinned_globally,
|
||||
:pinned, # Is topic pinned and viewer hasn't cleared the pin?
|
||||
:pinned_at, # Ignores clear pin
|
||||
:details,
|
||||
@@ -145,6 +146,10 @@ class TopicViewSerializer < ApplicationSerializer
|
||||
end
|
||||
alias_method :include_posted?, :has_topic_user?
|
||||
|
||||
def pinned_globally
|
||||
object.topic.pinned_globally
|
||||
end
|
||||
|
||||
def pinned
|
||||
PinnedCheck.pinned?(object.topic, object.topic_user)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user