- Add security

- Add configuration option on categories to enable
This commit is contained in:
Sam Saffron
2015-06-10 06:09:20 +10:00
parent a4e9ee4552
commit 09292d6ff9
6 changed files with 67 additions and 9 deletions
@@ -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