DEV: Add outlet wrapper for badges template (#28928)

* DEV: Add outlet wrapper for badges template

* Apply suggestions from code review

Co-authored-by: Sérgio Saquetim <1108771+megothss@users.noreply.github.com>

---------

Co-authored-by: Sérgio Saquetim <1108771+megothss@users.noreply.github.com>
This commit is contained in:
Amanda Alves Branquinho 2024-09-17 11:24:32 -03:00 committed by GitHub
parent 7ae116a389
commit 68a258ae7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 35 additions and 26 deletions

View File

@ -1,32 +1,41 @@
{{body-class "user-badges-page"}}
<section class="user-content" id="user-content">
{{#if this.siteSettings.max_favorite_badges}}
<p class="favorite-count">
{{i18n
"badges.favorite_count"
count=this.favoriteBadges.length
max=this.siteSettings.max_favorite_badges
}}
</p>
{{/if}}
<PluginOutlet
@name="user-badges-content"
@outletArgs={{hash
sortedBadges=this.sortedBadges
maxFavBadges=this.siteSettings.max_favorite_badges
favoriteBadges=this.favoriteBadges
}}
>
{{#if this.siteSettings.max_favorite_badges}}
<p class="favorite-count">
{{i18n
"badges.favorite_count"
count=this.favoriteBadges.length
max=this.siteSettings.max_favorite_badges
}}
</p>
{{/if}}
<div class="badge-group-list">
{{#each this.sortedBadges as |ub|}}
<BadgeCard
@badge={{ub.badge}}
@count={{ub.count}}
@canFavorite={{ub.can_favorite}}
@isFavorite={{ub.is_favorite}}
@username={{this.username}}
@canFavoriteMoreBadges={{this.canFavoriteMoreBadges}}
@onFavoriteClick={{action "favorite" ub}}
@filterUser="true"
<div class="badge-group-list">
{{#each this.sortedBadges as |ub|}}
<BadgeCard
@badge={{ub.badge}}
@count={{ub.count}}
@canFavorite={{ub.can_favorite}}
@isFavorite={{ub.is_favorite}}
@username={{this.username}}
@canFavoriteMoreBadges={{this.canFavoriteMoreBadges}}
@onFavoriteClick={{action "favorite" ub}}
@filterUser="true"
/>
{{/each}}
<PluginOutlet
@name="after-user-profile-badges"
@outletArgs={{hash user=this.user.model}}
/>
{{/each}}
<PluginOutlet
@name="after-user-profile-badges"
@outletArgs={{hash user=this.user.model}}
/>
</div>
</div>
</PluginOutlet>
</section>