mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 19:00:32 -06:00
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:
parent
e0df0f479a
commit
95390e3333
@ -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}}
|
||||
|
||||
|
@ -58,6 +58,12 @@
|
||||
height: 420px;
|
||||
}
|
||||
|
||||
.edit-category-tab-general {
|
||||
.category-chooser {
|
||||
width: 434px;
|
||||
}
|
||||
}
|
||||
|
||||
.disable_info_wrap {
|
||||
.cannot_delete_reason {
|
||||
top: -100px;
|
||||
|
Loading…
Reference in New Issue
Block a user