UX: User badges tweaks (#20408)

* UX: fix standalone badge padding

* UX: badge number formatting

* UX: copy

* DEV: Add LinkTo for the admin-badges/show count text

* UX: user badge awarded style update

---------

Co-authored-by: Martin Brennan <martin@discourse.org>
This commit is contained in:
chapoi 2023-02-23 09:21:26 +07:00 committed by GitHub
parent 64d1192bff
commit ab46a05d77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 20 deletions

View File

@ -286,10 +286,10 @@
{{#if this.grant_count}}
<div class="content-body current-badge-actions">
<div>
<LinkTo @route="badges.show" @model={{this}}>{{i18n
"badges.granted"
count=this.grant_count
}}</LinkTo>
<LinkTo @route="badges.show" @model={{this}}>
{{number this.grant_count}}
{{i18n "badges.awarded"}}
</LinkTo>
</div>
</div>
{{/if}}

View File

@ -41,15 +41,16 @@
<div class="badge-summary">{{html-safe this.summary}}</div>
{{#if this.displayCount}}
<div class="badge-granted">
{{html-safe
(i18n
"badges.granted_with_count"
count=this.displayCount
badgeUrl=this.url
)
}}
</div>
<LinkTo
@route="badges.show"
@model={{this.badge}}
class="badge-granted"
>
{{number this.displayCount}}
{{i18n "badges.awarded"}}
</LinkTo>
{{/if}}
</div>
</div>

View File

@ -132,7 +132,10 @@
}
.badge-granted {
display: block;
margin-top: 0.5em;
color: var(--primary-medium);
font-size: var(--font-down-1);
}
.grant-count {
@ -191,9 +194,6 @@
}
.badge-info {
display: flex;
flex: 1 1 auto;
align-items: center;
color: var(--primary);
h3 {
@ -216,7 +216,6 @@
}
.badge-contents {
padding: 0 5%;
h3 {
font-size: var(--font-up-3);
}

View File

@ -4121,9 +4121,7 @@ en:
granted:
one: "%{count} granted"
other: "%{count} granted"
granted_with_count:
one: '<a href="%{badgeUrl}" title="%{count} granted" class="grant-count">%{count}x</a> <span class="grant-text">granted</span>'
other: '<a href="%{badgeUrl}" title="%{count} granted" class="grant-count">%{count}x</a> <span class="grant-text">granted</span>'
awarded: awarded
select_badge_for_title: Select a badge to use as your title
none: "(none)"
successfully_granted: "Successfully granted %{badge} to %{username}"