FIX: You shouldn't be able to add a parent to Uncategorized
This commit is contained in:
@@ -23,6 +23,8 @@ export default Discourse.ObjectController.extend(Discourse.ModalFunctionality, {
|
||||
return Discourse.Category.list().filterBy('parent_category_id', this.get('id'));
|
||||
}.property('model.id'),
|
||||
|
||||
canSelectParentCategory: Em.computed.not('isUncategorizedCategory'),
|
||||
|
||||
onShow: function() {
|
||||
this.changeSize();
|
||||
this.titleChanged();
|
||||
|
||||
+13
-11
@@ -4,17 +4,19 @@
|
||||
{{text-field value=name placeholderKey="category.name_placeholder" maxlength="50"}}
|
||||
</section>
|
||||
|
||||
<section class='field'>
|
||||
{{#if subCategories}}
|
||||
<label>{{i18n categories.subcategories}}</label>
|
||||
{{#each subCategories}}
|
||||
{{category-badge this}}
|
||||
{{/each}}
|
||||
{{else}}
|
||||
<label>{{i18n category.parent}}</label>
|
||||
{{category-chooser valueAttribute="id" value=parent_category_id categories=parentCategories rootNone=true}}
|
||||
{{/if}}
|
||||
</section>
|
||||
{{#if canSelectParentCategory}}
|
||||
<section class='field'>
|
||||
{{#if subCategories}}
|
||||
<label>{{i18n categories.subcategories}}</label>
|
||||
{{#each subCategories}}
|
||||
{{category-badge this}}
|
||||
{{/each}}
|
||||
{{else}}
|
||||
<label>{{i18n category.parent}}</label>
|
||||
{{category-chooser valueAttribute="id" value=parent_category_id categories=parentCategories rootNone=true}}
|
||||
{{/if}}
|
||||
</section>
|
||||
{{/if}}
|
||||
|
||||
{{#if showDescription}}
|
||||
<section class='field'>
|
||||
|
||||
Reference in New Issue
Block a user