FIX: Show parent and subcategories for 2nd level categories (#8579)

The maximum level used to be one, which meant that a category could be
either a parent or a child. If it was a parent, the subcategories were
shown; if it was a child then the parent selector was shown.

With multiple levels of nesting, a category can be both a parent and a
child.
This commit is contained in:
Dan Ungureanu 2019-12-18 17:44:28 +02:00 committed by GitHub
parent e0df0f479a
commit 95390e3333
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 15 deletions

View File

@ -10,21 +10,23 @@
{{#if canSelectParentCategory}}
<section class='field'>
{{#if subCategories}}
<label>{{i18n 'categories.subcategories'}}</label>
{{#each subCategories as |s|}}
{{category-badge s hideParent="true"}}
{{/each}}
{{else}}
<label>{{i18n 'category.parent'}}</label>
{{category-chooser
none="category.none"
value=category.parent_category_id
excludeCategoryId=category.id
categories=parentCategories
allowSubCategories=true
allowUncategorized=false}}
{{/if}}
<label>{{i18n 'category.parent'}}</label>
{{category-chooser
none="category.none"
value=category.parent_category_id
excludeCategoryId=category.id
categories=parentCategories
allowSubCategories=true
allowUncategorized=false}}
</section>
{{/if}}
{{#if subCategories}}
<section class='field'>
<label>{{i18n 'categories.subcategories'}}</label>
{{#each subCategories as |s|}}
{{category-badge s hideParent="true"}}
{{/each}}
</section>
{{/if}}

View File

@ -58,6 +58,12 @@
height: 420px;
}
.edit-category-tab-general {
.category-chooser {
width: 434px;
}
}
.disable_info_wrap {
.cannot_delete_reason {
top: -100px;