Skip to content

A platform for community discussion. Free, open, simple.

DEV: Remove mobile template for `subcategories-with-featured-topics` (#29513)

David Taylor210a295a87b3
diff --git a/app/assets/javascripts/discourse/app/components/subcategories-with-featured-topics.hbs b/app/assets/javascripts/discourse/app/components/subcategories-with-featured-topics.hbs
index 9629c4caea5..4d2688a3f12 100644
--- a/app/assets/javascripts/discourse/app/components/subcategories-with-featured-topics.hbs
+++ b/app/assets/javascripts/discourse/app/components/subcategories-with-featured-topics.hbs
@@ -1,24 +1,43 @@
{{#each this.categories as |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>
+ {{#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>
+ </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>
+ {{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>
+ {{/if}}
{{/each}}
\ No newline at end of file
diff --git a/app/assets/javascripts/discourse/app/templates/mobile/components/subcategories-with-featured-topics.hbs b/app/assets/javascripts/discourse/app/templates/mobile/components/subcategories-with-featured-topics.hbs
deleted file mode 100644
index dbd77d2a9bf..00000000000
--- a/app/assets/javascripts/discourse/app/templates/mobile/components/subcategories-with-featured-topics.hbs
+++ /dev/null
@@ -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}}
\ No newline at end of file