DEV: Add subcategories with featured topics list plugin outlet (#30538)

This adds plugin outlets for mobile and desktop views of the subcategories with featured topics list.
This commit is contained in:
Gabriel Grubba 2025-01-03 08:18:57 -05:00 committed by GitHub
parent 6c7eaf99af
commit 13b9493bf0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,43 +1,53 @@
{{#each this.categories as |category|}}
{{#if this.site.mobileView}}
<div class="category-list subcategory-list with-topics">
<div class="parent-category">
<CategoryTitleLink @category={{category}} />
<span class="stat" title={{category.statTitle}}>{{html-safe
category.stat
}}</span>
<PluginOutlet
@name="mobile-subcategories-with-featured-topics-list"
@outletArgs={{hash category=category}}
>
<div class="category-list subcategory-list with-topics">
<div class="parent-category">
<CategoryTitleLink @category={{category}} />
<span class="stat" title={{category.statTitle}}>{{html-safe
category.stat
}}</span>
</div>
<div class="subcategories">
{{#each category.serializedSubcategories as |subCategory|}}
<ParentCategoryRow @category={{subCategory}} @showTopics={{true}} />
{{else}}
{{! No subcategories... so just show the parent to avoid confusion }}
<ParentCategoryRow @category={{category}} @showTopics={{true}} />
{{/each}}
</div>
</div>
<div class="subcategories">
{{#each category.serializedSubcategories as |subCategory|}}
<ParentCategoryRow @category={{subCategory}} @showTopics={{true}} />
{{else}}
{{! No subcategories... so just show the parent to avoid confusion }}
<ParentCategoryRow @category={{category}} @showTopics={{true}} />
{{/each}}
</div>
</div>
</PluginOutlet>
{{else}}
<table class="category-list subcategory-list with-topics">
<thead>
<tr>
<th class="parent-category">
<CategoryTitleLink @category={{category}} />
<span class="stat" title={{category.statTitle}}>{{html-safe
category.stat
}}</span>
</th>
<th class="topics">{{i18n "categories.topics"}}</th>
<th class="latest">{{i18n "categories.latest"}}</th>
</tr>
</thead>
<tbody aria-labelledby="categories-only-category">
{{#each category.serializedSubcategories as |subCategory|}}
<ParentCategoryRow @category={{subCategory}} @showTopics={{true}} />
{{else}}
{{! No subcategories... so just show the parent to avoid confusion }}
<ParentCategoryRow @category={{category}} @showTopics={{true}} />
{{/each}}
</tbody>
</table>
<PluginOutlet
@name="subcategories-with-featured-topics-list"
@outletArgs={{hash category=category}}
>
<table class="category-list subcategory-list with-topics">
<thead>
<tr>
<th class="parent-category">
<CategoryTitleLink @category={{category}} />
<span class="stat" title={{category.statTitle}}>{{html-safe
category.stat
}}</span>
</th>
<th class="topics">{{i18n "categories.topics"}}</th>
<th class="latest">{{i18n "categories.latest"}}</th>
</tr>
</thead>
<tbody aria-labelledby="categories-only-category">
{{#each category.serializedSubcategories as |subCategory|}}
<ParentCategoryRow @category={{subCategory}} @showTopics={{true}} />
{{else}}
{{! No subcategories... so just show the parent to avoid confusion }}
<ParentCategoryRow @category={{category}} @showTopics={{true}} />
{{/each}}
</tbody>
</table>
</PluginOutlet>
{{/if}}
{{/each}}