FIX: enable_accepted_answers state was not correctly displayed (#82)
This commit is contained in:
parent
17912bdda3
commit
e974c35d38
|
@ -1,11 +1,15 @@
|
||||||
{{#unless siteSettings.allow_solved_on_all_topics}}
|
{{#unless siteSettings.allow_solved_on_all_topics}}
|
||||||
<h3>{{i18n 'solved.title'}}</h3>
|
<h3>{{i18n 'solved.title'}}</h3>
|
||||||
<section class='field'>
|
<section class='field'>
|
||||||
<div class="enable-accepted-answer">
|
<div class="enable-accepted-answer">
|
||||||
<label class="checkbox-label">
|
<label class="checkbox-label">
|
||||||
{{input type="checkbox" checked=category.enable_accepted_answers}}
|
{{input
|
||||||
{{i18n 'solved.allow_accepted_answers'}}
|
type="checkbox"
|
||||||
</label>
|
checked=(readonly category.enable_accepted_answers)
|
||||||
</div>
|
change=(action "onChangeSetting" value="target.checked")
|
||||||
</section>
|
}}
|
||||||
|
{{i18n 'solved.allow_accepted_answers'}}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
export default {
|
||||||
|
actions: {
|
||||||
|
onChangeSetting(value) {
|
||||||
|
this.set(
|
||||||
|
"category.custom_fields.enable_accepted_answers",
|
||||||
|
value ? "true" : "false"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
|
@ -10,13 +10,8 @@ export default {
|
||||||
enable_accepted_answers: Ember.computed(
|
enable_accepted_answers: Ember.computed(
|
||||||
"custom_fields.enable_accepted_answers",
|
"custom_fields.enable_accepted_answers",
|
||||||
{
|
{
|
||||||
get(enableField) {
|
get(fieldName) {
|
||||||
return enableField === "true";
|
return Ember.get(this.custom_fields, fieldName) === "true";
|
||||||
},
|
|
||||||
set(value) {
|
|
||||||
value = value ? "true" : "false";
|
|
||||||
this.set("custom_fields.enable_accepted_answers", value);
|
|
||||||
return value;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue