FEATURE: Add solved icon for topic titles in search results and other topic lists

This commit is contained in:
Vinoth Kannan
2019-03-13 15:59:07 +05:30
parent bd5685c836
commit e9be43becd
4 changed files with 51 additions and 30 deletions
@@ -0,0 +1,19 @@
module TopicAnswerMixin
def self.included(klass)
klass.attributes :has_accepted_answer, :can_have_answer
end
def has_accepted_answer
object.custom_fields["accepted_answer_post_id"] ? true : false
end
def can_have_answer
return true if SiteSetting.allow_solved_on_all_topics
return false if object.closed || object.archived
return scope.allow_accepted_answers_on_category?(object.category_id)
end
def include_can_have_answer?
SiteSetting.empty_box_on_unsolved
end
end