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}} {{#if this.grant_count}}
<div class="content-body current-badge-actions"> <div class="content-body current-badge-actions">
<div> <div>
<LinkTo @route="badges.show" @model={{this}}>{{i18n <LinkTo @route="badges.show" @model={{this}}>
"badges.granted" {{number this.grant_count}}
count=this.grant_count {{i18n "badges.awarded"}}
}}</LinkTo> </LinkTo>
</div> </div>
</div> </div>
{{/if}} {{/if}}

View File

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

View File

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

View File

@ -4121,9 +4121,7 @@ en:
granted: granted:
one: "%{count} granted" one: "%{count} granted"
other: "%{count} granted" other: "%{count} granted"
granted_with_count: awarded: awarded
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>'
select_badge_for_title: Select a badge to use as your title select_badge_for_title: Select a badge to use as your title
none: "(none)" none: "(none)"
successfully_granted: "Successfully granted %{badge} to %{username}" successfully_granted: "Successfully granted %{badge} to %{username}"