mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 11:23:36 +08:00
DEV: Indicate whether categories are missing on categories page (#27608)
This commit is contained in:
parent
f3a89620a1
commit
0d6bd5207d
|
@ -40,6 +40,12 @@
|
|||
@listType={{this.listType}}
|
||||
/>
|
||||
{{/each}}
|
||||
{{#if (gt this.category.unloadedSubcategoryCount 0)}}
|
||||
{{i18n
|
||||
"category_row.subcategory_count"
|
||||
count=this.category.unloadedSubcategoryCount
|
||||
}}
|
||||
{{/if}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{else if this.category.subcategories}}
|
||||
|
@ -50,6 +56,12 @@
|
|||
@listType={{this.listType}}
|
||||
/>
|
||||
{{/each}}
|
||||
{{#if (gt this.category.unloadedSubcategoryCount 0)}}
|
||||
{{i18n
|
||||
"category_row.subcategory_count"
|
||||
count=this.category.unloadedSubcategoryCount
|
||||
}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</td>
|
||||
|
|
|
@ -491,6 +491,11 @@ export default class Category extends RestModel {
|
|||
return this.site.categories.filterBy("parent_category_id", this.id);
|
||||
}
|
||||
|
||||
@computed("subcategories")
|
||||
get unloadedSubcategoryCount() {
|
||||
return this.subcategory_count - this.subcategories.length;
|
||||
}
|
||||
|
||||
@computed("subcategory_list")
|
||||
get serializedSubcategories() {
|
||||
return this.subcategory_list?.map((c) => Category.create(c));
|
||||
|
|
Loading…
Reference in New Issue
Block a user