mirror of
https://github.com/discourse/discourse-solved.git
synced 2026-09-29 03:43:56 -04:00
FEATURE: display icon on front page
This commit is contained in:
@@ -3,6 +3,7 @@ import PostView from 'discourse/views/post';
|
||||
import { Button } from 'discourse/views/post-menu';
|
||||
import Topic from 'discourse/models/topic';
|
||||
import User from 'discourse/models/user';
|
||||
import TopicStatus from 'discourse/views/topic-status'
|
||||
|
||||
export default {
|
||||
name: 'extend-for-solved-button',
|
||||
@@ -39,6 +40,21 @@ export default {
|
||||
}.property('accepted_answer', 'id')
|
||||
});
|
||||
|
||||
TopicStatus.reopen({
|
||||
statuses: function(){
|
||||
var results = this._super();
|
||||
if (this.topic.has_accepted_answer) {
|
||||
results.push({
|
||||
openTag: 'span',
|
||||
closeTag: 'span',
|
||||
title: I18n.t('solved.has_accepted_answer'),
|
||||
icon: 'check-square'
|
||||
});
|
||||
}
|
||||
return results;
|
||||
}.property()
|
||||
});
|
||||
|
||||
PostView.reopen({
|
||||
classNameBindings: ['post.accepted_answer:accepted-answer']
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user