mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Badge preview not displaying grant count (#23269)
<img width="510" alt="Screenshot 2023-08-25 at 8 19 38 AM" src="https://github.com/discourse/discourse/assets/50783505/9ebf467e-7b3b-49e2-91d9-43e37b838431">
This commit is contained in:
@@ -5,15 +5,17 @@
|
||||
>
|
||||
<:body>
|
||||
{{#if @model.badge.errors}}
|
||||
<p class="error-header">{{i18n
|
||||
"admin.badges.preview.sql_error_header"
|
||||
}}</p>
|
||||
<p class="error-header">
|
||||
{{i18n "admin.badges.preview.sql_error_header"}}
|
||||
</p>
|
||||
<pre class="badge-errors">{{@model.badge.errors}}</pre>
|
||||
{{else}}
|
||||
<p class="grant-count">
|
||||
{{#if this.count}}
|
||||
{{#if @model.badge.grant_count}}
|
||||
{{html-safe
|
||||
(i18n "admin.badges.preview.grant_count" count=@model.badge.count)
|
||||
(i18n
|
||||
"admin.badges.preview.grant_count" count=@model.badge.grant_count
|
||||
)
|
||||
}}
|
||||
{{else}}
|
||||
{{html-safe (i18n "admin.badges.preview.no_grant_count")}}
|
||||
@@ -32,7 +34,7 @@
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if this.sample}}
|
||||
{{#if @model.badge.sample}}
|
||||
<p class="sample">
|
||||
{{i18n "admin.badges.preview.sample"}}
|
||||
</p>
|
||||
|
||||
@@ -33,7 +33,7 @@ export default class BadgePreview extends Component {
|
||||
this.args.model.badge.grant_count
|
||||
);
|
||||
} else {
|
||||
return this.args.model.badge.sample.length !== 10;
|
||||
return this.args.model.badge.sample?.length !== 10;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -175,11 +175,17 @@
|
||||
<a
|
||||
href
|
||||
{{on "click" (fn this.showPreview this.buffered "false")}}
|
||||
>{{i18n "admin.badges.preview.link_text"}}</a>
|
||||
class="preview-badge"
|
||||
>
|
||||
{{i18n "admin.badges.preview.link_text"}}</a>
|
||||
|
|
||||
<a href {{on "click" (fn this.showPreview this.buffered "true")}}>{{i18n
|
||||
"admin.badges.preview.plan_text"
|
||||
}}</a>
|
||||
<a
|
||||
href
|
||||
{{on "click" (fn this.showPreview this.buffered "true")}}
|
||||
class="preview-badge-plan"
|
||||
>
|
||||
{{i18n "admin.badges.preview.plan_text"}}
|
||||
</a>
|
||||
{{#if this.preview_loading}}
|
||||
{{i18n "loading"}}
|
||||
{{/if}}
|
||||
|
||||
Reference in New Issue
Block a user