mirror of
https://github.com/discourse/discourse.git
synced 2025-01-16 03:42:41 +08:00
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:
parent
6c7eaf99af
commit
13b9493bf0
|
@ -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}}
|
Loading…
Reference in New Issue
Block a user