mirror of
https://github.com/discourse/discourse-solved.git
synced 2026-10-07 15:30:20 -04:00
- Add security
- Add configuration option on categories to enable
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
<section class='field'>
|
||||
<div class="enable-accepted-answer">
|
||||
<label class="checkbox-label">
|
||||
{{input type="checkbox" checked=model.enable_accepted_answers}}
|
||||
{{i18n 'accepted_answer.allow_accepted_answers'}}
|
||||
</label>
|
||||
</div>
|
||||
</section>
|
||||
@@ -8,6 +8,16 @@ export default {
|
||||
name: 'extend-for-solved-button',
|
||||
initialize: function() {
|
||||
|
||||
Discourse.Category.reopen({
|
||||
enable_accepted_answers: function(key, value){
|
||||
if (arguments.length > 1) {
|
||||
this.set('custom_fields.enable_accepted_answers', value ? "true" : "false");
|
||||
}
|
||||
var fields = this.get('custom_fields');
|
||||
return fields && (fields.enable_accepted_answers === "true");
|
||||
}.property('custom_fields')
|
||||
}),
|
||||
|
||||
Topic.reopen({
|
||||
|
||||
// keeping this here cause there is complex localization
|
||||
|
||||
Reference in New Issue
Block a user