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