mirror of
https://github.com/discourse/discourse.git
synced 2025-02-07 00:25:31 +08:00
DEV: Remove mobile template for subcategories-with-featured-topics
(#29513)
We are moving away from the mobile-specific template pattern in favor of logical `{{#if}}` statements. This brings us closer to a standard Ember app, makes testing easier, and reduces duplicate code.
This commit is contained in:
parent
8300380287
commit
210a295a87
|
@ -1,24 +1,43 @@
|
||||||
{{#each this.categories as |category|}}
|
{{#each this.categories as |category|}}
|
||||||
<table class="category-list subcategory-list with-topics">
|
{{#if this.site.mobileView}}
|
||||||
<thead>
|
<div class="category-list subcategory-list with-topics">
|
||||||
<tr>
|
<div class="parent-category">
|
||||||
<th class="parent-category">
|
<CategoryTitleLink @category={{category}} />
|
||||||
<CategoryTitleLink @category={{category}} />
|
<span class="stat" title={{category.statTitle}}>{{html-safe
|
||||||
<span class="stat" title={{category.statTitle}}>{{html-safe
|
category.stat
|
||||||
category.stat
|
}}</span>
|
||||||
}}</span>
|
</div>
|
||||||
</th>
|
<div class="subcategories">
|
||||||
<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}} />
|
</div>
|
||||||
{{else}}
|
</div>
|
||||||
{{! No subcategories... so just show the parent to avoid confusion }}
|
{{else}}
|
||||||
<ParentCategoryRow @category={{category}} @showTopics={{true}} />
|
<table class="category-list subcategory-list with-topics">
|
||||||
{{/each}}
|
<thead>
|
||||||
</tbody>
|
<tr>
|
||||||
</table>
|
<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>
|
||||||
|
{{/if}}
|
||||||
{{/each}}
|
{{/each}}
|
|
@ -1,18 +0,0 @@
|
||||||
{{#each this.categories as |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>
|
|
||||||
{{/each}}
|
|
Loading…
Reference in New Issue
Block a user