2023-08-15 01:33:45 +08:00
|
|
|
<DModal
|
|
|
|
@closeModal={{@closeModal}}
|
|
|
|
@title={{i18n "admin.badges.preview.modal_title"}}
|
|
|
|
class="badge-query-preview"
|
|
|
|
>
|
|
|
|
<:body>
|
|
|
|
{{#if @model.badge.errors}}
|
2023-08-25 22:19:01 +08:00
|
|
|
<p class="error-header">
|
|
|
|
{{i18n "admin.badges.preview.sql_error_header"}}
|
|
|
|
</p>
|
2023-08-15 01:33:45 +08:00
|
|
|
<pre class="badge-errors">{{@model.badge.errors}}</pre>
|
|
|
|
{{else}}
|
|
|
|
<p class="grant-count">
|
2023-08-25 22:19:01 +08:00
|
|
|
{{#if @model.badge.grant_count}}
|
2023-08-15 01:33:45 +08:00
|
|
|
{{html-safe
|
2023-08-25 22:19:01 +08:00
|
|
|
(i18n
|
|
|
|
"admin.badges.preview.grant_count" count=@model.badge.grant_count
|
|
|
|
)
|
2023-08-15 01:33:45 +08:00
|
|
|
}}
|
|
|
|
{{else}}
|
|
|
|
{{html-safe (i18n "admin.badges.preview.no_grant_count")}}
|
|
|
|
{{/if}}
|
|
|
|
</p>
|
|
|
|
|
|
|
|
{{#if this.countWarning}}
|
|
|
|
<div class="count-warning">
|
|
|
|
<p class="heading">
|
2024-09-13 23:50:52 +08:00
|
|
|
{{d-icon "triangle-exclamation"}}
|
2023-08-15 01:33:45 +08:00
|
|
|
{{i18n "admin.badges.preview.bad_count_warning.header"}}
|
|
|
|
</p>
|
|
|
|
<p class="body">
|
|
|
|
{{i18n "admin.badges.preview.bad_count_warning.text"}}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
|
2023-08-25 22:19:01 +08:00
|
|
|
{{#if @model.badge.sample}}
|
2023-08-15 01:33:45 +08:00
|
|
|
<p class="sample">
|
|
|
|
{{i18n "admin.badges.preview.sample"}}
|
|
|
|
</p>
|
|
|
|
<ul>
|
|
|
|
{{#each this.processedSample as |html|}}
|
|
|
|
<li>{{html-safe html}}</li>
|
|
|
|
{{/each}}
|
|
|
|
</ul>
|
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
{{#if this.hasQueryPlan}}
|
|
|
|
<div class="badge-query-plan">
|
|
|
|
{{html-safe this.queryPlanHtml}}
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
{{/if}}
|
|
|
|
</:body>
|
|
|
|
</DModal>
|