FIX: User's "Top badges" grid (#13752)

FIX: User’s “Top badges” grid (#13752)

Fixes a regression introduced in #13719

diff --git a/app/assets/javascripts/discourse/app/templates/user/summary.hbs b/app/assets/javascripts/discourse/app/templates/user/summary.hbs
index de025db..1199c4b 100644
--- a/app/assets/javascripts/discourse/app/templates/user/summary.hbs
+++ b/app/assets/javascripts/discourse/app/templates/user/summary.hbs
@@ -151,13 +151,21 @@
     {{#if siteSettings.enable_badges}}
       <div class="top-section badges-section">
         <h3 class="stats-title">{{i18n "user.summary.top_badges"}}</h3>
-        {{#each model.badges as |badge|}}
-          {{badge-card badge=badge count=badge.count username=user.username_lower}}
+
+        {{#if model.badges}}
+          <div class="badge-group-list">
+            {{#each model.badges as |badge|}}
+              {{badge-card badge=badge count=badge.count username=user.username_lower}}
+            {{/each}}
+          </div>
         {{else}}
           <p>{{i18n "user.summary.no_badges"}}</p>
-        {{/each}}
+        {{/if}}
+
         {{#if moreBadges}}
-          <p>{{#link-to "user.badges" user class="more"}}{{i18n "user.summary.more_badges"}}{{/link-to}}</p>
+          {{#link-to "user.badges" user class="more"}}
+            {{i18n "user.summary.more_badges"}}
+          {{/link-to}}
         {{/if}}
       </div>
     {{/if}}

GitHub sha: c458cebfc360b748fccc4f2ec7a0b3d94320ad78

This commit appears in #13752 which was approved by eviltrout. It was merged by CvX.