From 95390e333394a03b426993269f53d28d38b84066 Mon Sep 17 00:00:00 2001 From: Dan Ungureanu Date: Wed, 18 Dec 2019 17:44:28 +0200 Subject: [PATCH] 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. --- .../components/edit-category-general.hbs | 32 ++++++++++--------- app/assets/stylesheets/desktop/modal.scss | 6 ++++ 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/app/assets/javascripts/discourse/templates/components/edit-category-general.hbs b/app/assets/javascripts/discourse/templates/components/edit-category-general.hbs index 1c30b0c7623..c157d22f0c1 100644 --- a/app/assets/javascripts/discourse/templates/components/edit-category-general.hbs +++ b/app/assets/javascripts/discourse/templates/components/edit-category-general.hbs @@ -10,21 +10,23 @@ {{#if canSelectParentCategory}}
- {{#if subCategories}} - - {{#each subCategories as |s|}} - {{category-badge s hideParent="true"}} - {{/each}} - {{else}} - - {{category-chooser - none="category.none" - value=category.parent_category_id - excludeCategoryId=category.id - categories=parentCategories - allowSubCategories=true - allowUncategorized=false}} - {{/if}} + + {{category-chooser + none="category.none" + value=category.parent_category_id + excludeCategoryId=category.id + categories=parentCategories + allowSubCategories=true + allowUncategorized=false}} +
+ {{/if}} + + {{#if subCategories}} +
+ + {{#each subCategories as |s|}} + {{category-badge s hideParent="true"}} + {{/each}}
{{/if}} diff --git a/app/assets/stylesheets/desktop/modal.scss b/app/assets/stylesheets/desktop/modal.scss index 9a2adb962b4..c897e3fbb4c 100644 --- a/app/assets/stylesheets/desktop/modal.scss +++ b/app/assets/stylesheets/desktop/modal.scss @@ -58,6 +58,12 @@ height: 420px; } + .edit-category-tab-general { + .category-chooser { + width: 434px; + } + } + .disable_info_wrap { .cannot_delete_reason { top: -100px;