FEATURE: education panel on pinning at bottom of topics

This commit is contained in:
Sam
2014-04-10 15:53:31 +10:00
parent cfc1444177
commit 97269fc918
6 changed files with 77 additions and 36 deletions

View File

@@ -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