When creating/editing a category the parent shoudl be none.

This commit is contained in:
Robin Ward 2014-02-10 14:08:16 -05:00
parent 45afed8720
commit f1a9e52d7e
2 changed files with 6 additions and 2 deletions

View File

@ -29,7 +29,7 @@
{{/each}}
{{else}}
<label>{{i18n category.parent}}</label>
{{categoryChooser valueAttribute="id" value=parent_category_id categories=parentCategories}}
{{categoryChooser valueAttribute="id" value=parent_category_id categories=parentCategories rootNone=true}}
{{/if}}
</section>

View File

@ -26,7 +26,11 @@ Discourse.CategoryChooserView = Discourse.ComboboxView.extend({
none: function() {
if (Discourse.User.currentProp('staff') || Discourse.SiteSettings.allow_uncategorized_topics) {
return Discourse.Category.list().findBy('id', Discourse.Site.currentProp('uncategorized_category_id'));
if (this.get('rootNone')) {
return "category.none";
} else {
return Discourse.Category.list().findBy('id', Discourse.Site.currentProp('uncategorized_category_id'));
}
} else {
return 'category.choose';
}