mirror of
https://github.com/discourse/discourse.git
synced 2025-05-12 04:23:04 +08: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}}
|
{{#if canSelectParentCategory}}
|
||||||
<section class='field'>
|
<section class='field'>
|
||||||
{{#if subCategories}}
|
<label>{{i18n 'category.parent'}}</label>
|
||||||
<label>{{i18n 'categories.subcategories'}}</label>
|
{{category-chooser
|
||||||
{{#each subCategories as |s|}}
|
none="category.none"
|
||||||
{{category-badge s hideParent="true"}}
|
value=category.parent_category_id
|
||||||
{{/each}}
|
excludeCategoryId=category.id
|
||||||
{{else}}
|
categories=parentCategories
|
||||||
<label>{{i18n 'category.parent'}}</label>
|
allowSubCategories=true
|
||||||
{{category-chooser
|
allowUncategorized=false}}
|
||||||
none="category.none"
|
</section>
|
||||||
value=category.parent_category_id
|
{{/if}}
|
||||||
excludeCategoryId=category.id
|
|
||||||
categories=parentCategories
|
{{#if subCategories}}
|
||||||
allowSubCategories=true
|
<section class='field'>
|
||||||
allowUncategorized=false}}
|
<label>{{i18n 'categories.subcategories'}}</label>
|
||||||
{{/if}}
|
{{#each subCategories as |s|}}
|
||||||
|
{{category-badge s hideParent="true"}}
|
||||||
|
{{/each}}
|
||||||
</section>
|
</section>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
@ -58,6 +58,12 @@
|
|||||||
height: 420px;
|
height: 420px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.edit-category-tab-general {
|
||||||
|
.category-chooser {
|
||||||
|
width: 434px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.disable_info_wrap {
|
.disable_info_wrap {
|
||||||
.cannot_delete_reason {
|
.cannot_delete_reason {
|
||||||
top: -100px;
|
top: -100px;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user