discourse/app/assets/javascripts/admin/addon/templates/modal/admin-badge-preview.hbs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

56 lines
1.5 KiB
Handlebars
Raw Normal View History

<DModalBody @title="admin.badges.preview.modal_title" @class="badge-query-preview">
{{#if errors}}
2019-02-19 03:30:52 -05:00
<p class="error-header">{{i18n "admin.badges.preview.sql_error_header"}}</p>
<pre class="badge-errors">{{errors}}</pre>
{{!--
TODO we want some help pages for this, link to those instead
<p>
{{i18n "admin.badges.preview.error_help"}}
</p>
<ul>
<li><a href="https://meta.discourse.org/t/triggered-custom-badge-queries/19336">https://meta.discourse.org/t/triggered-custom-badge-queries/19336</a></li>
</ul>
--}}
2019-02-19 03:30:52 -05:00
{{else}}
<p class="grant-count">
{{#if count}}
{{html-safe (i18n "admin.badges.preview.grant_count" count=count)}}
{{else}}
{{html-safe (i18n "admin.badges.preview.no_grant_count")}}
{{/if}}
</p>
2019-02-19 03:30:52 -05:00
{{#if countWarning}}
<div class="count-warning">
2019-02-19 03:30:52 -05:00
<p class="heading">
{{d-icon "exclamation-triangle"}}
2019-02-19 03:30:52 -05:00
{{i18n "admin.badges.preview.bad_count_warning.header"}}
</p>
<p class="body">
{{i18n "admin.badges.preview.bad_count_warning.text"}}
</p>
</div>
{{/if}}
{{#if sample}}
<p class="sample">
2019-02-19 03:30:52 -05:00
{{i18n "admin.badges.preview.sample"}}
</p>
<ul>
2019-02-19 03:30:52 -05:00
{{#each processedSample as |html|}}
<li>{{html-safe html}}</li>
{{/each}}
</ul>
{{/if}}
2019-02-19 03:30:52 -05:00
{{#if hasQueryPlan}}
<div class="badge-query-plan">
{{html-safe queryPlanHtml}}
2019-02-19 03:30:52 -05:00
</div>
{{/if}}
{{/if}}
</DModalBody>