FIX: `user/badges` grid fix (#13729)

No more special CSS just for this path.
This commit is contained in:
Jarek Radosz 2021-07-14 16:43:24 +02:00 committed by GitHub
parent c750bfb4af
commit f89b135a21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 22 deletions

View File

@ -1,16 +1,20 @@
{{#d-section pageClass="user-badges" class="user-content user-badges-list"}}
{{#d-section pageClass="user-badges" class="user-content"}}
<p class="favorite-count">
{{i18n "badges.favorite_count" count=this.favoriteBadges.length max=siteSettings.max_favorite_badges}}
</p>
{{#each sortedBadges as |ub|}}
{{badge-card
badge=ub.badge
count=ub.count
canFavorite=ub.can_favorite
isFavorite=ub.is_favorite
username=username
canFavoriteMoreBadges=canFavoriteMoreBadges
onFavoriteClick=(action "favorite" ub)
filterUser="true"}}
{{/each}}
<div class="badge-group-list">
{{#each sortedBadges as |ub|}}
{{badge-card
badge=ub.badge
count=ub.count
canFavorite=ub.can_favorite
isFavorite=ub.is_favorite
username=username
canFavoriteMoreBadges=canFavoriteMoreBadges
onFavoriteClick=(action "favorite" ub)
filterUser="true"
}}
{{/each}}
</div>
{{/d-section}}

View File

@ -29,7 +29,7 @@ acceptance("User Anonymous", function () {
test("Badges", async function (assert) {
await visit("/u/eviltrout/badges");
assert.ok($("body.user-badges-page").length, "has the body class");
assert.ok(exists(".user-badges-list .badge-card"), "shows a badge");
assert.ok(exists(".badge-group-list .badge-card"), "shows a badge");
});
test("Restricted Routes", async function (assert) {

View File

@ -55,15 +55,6 @@
background-color: var(--secondary);
box-sizing: border-box;
&.user-badges-list {
display: flex;
flex-wrap: wrap;
}
&.user-badges-list .favorite-count {
flex: 100%;
}
.btn.right {
float: right;
}