From 210a295a87b3f627d5025dc94f57cd868e7cba89 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 31 Oct 2024 16:12:16 +0000 Subject: [PATCH] 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. --- .../subcategories-with-featured-topics.hbs | 63 ++++++++++++------- .../subcategories-with-featured-topics.hbs | 18 ------ 2 files changed, 41 insertions(+), 40 deletions(-) delete mode 100644 app/assets/javascripts/discourse/app/templates/mobile/components/subcategories-with-featured-topics.hbs 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|}} - - - - - - - - - - {{#each category.serializedSubcategories as |subCategory|}} - - {{else}} - {{! No subcategories... so just show the parent to avoid confusion }} - - {{/each}} - -
- - {{html-safe - category.stat - }} - {{i18n "categories.topics"}}{{i18n "categories.latest"}}
+ {{#if this.site.mobileView}} +
+
+ + {{html-safe + category.stat + }} +
+
+ {{#each category.serializedSubcategories as |subCategory|}} + + {{else}} + {{! No subcategories... so just show the parent to avoid confusion }} + + {{/each}} +
+
+ {{else}} + + + + + + + + + + {{#each category.serializedSubcategories as |subCategory|}} + + {{else}} + {{! No subcategories... so just show the parent to avoid confusion }} + + {{/each}} + +
+ + {{html-safe + category.stat + }} + {{i18n "categories.topics"}}{{i18n "categories.latest"}}
+ {{/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|}} -
-
- - {{html-safe - category.stat - }} -
-
- {{#each category.serializedSubcategories as |subCategory|}} - - {{else}} - {{! No subcategories... so just show the parent to avoid confusion }} - - {{/each}} -
-
-{{/each}} \ No newline at end of file