{{#d-section class="current-badge content-body"}}
{{#if readOnly}} {{input type="text" name="name" value=buffered.name disabled=true}} {{else}} {{input type="text" name="name" value=buffered.name}} {{/if}}
{{input type="text" name="icon" value=buffered.icon}}

{{i18n 'admin.badges.icon_help'}}

{{input type="text" name="image" value=buffered.image}}

{{i18n 'admin.badges.image_help'}}

{{combo-box name="badge_type_id" value=buffered.badge_type_id content=badgeTypes allowInitialValueMutation=true isDisabled=readOnly}}
{{combo-box name="badge_grouping_id" value=buffered.badge_grouping_id content=badgeGroupings class="badge-selector" nameProperty="name"}}
{{#if buffered.system}} {{textarea name="description" value=buffered.description disabled=true}} {{else}} {{textarea name="description" value=buffered.description}} {{/if}}
{{#if buffered.system}} {{textarea name="long_description" value=buffered.long_description disabled=true}} {{else}} {{textarea name="long_description" value=buffered.long_description}} {{/if}}
{{#if siteSettings.enable_badge_sql}}
{{ace-editor content=buffered.query mode="sql" disabled=readOnly}}
{{#if hasQuery}} {{i18n 'admin.badges.preview.link_text'}} | {{i18n 'admin.badges.preview.plan_text'}} {{#if preview_loading}} {{i18n 'loading'}}... {{/if}}
{{combo-box name="trigger" value=buffered.trigger content=badgeTriggers optionValuePath="content.id" optionLabelPath="content.name" disabled=readOnly}}
{{/if}} {{/if}}
{{savingStatus}} {{#unless readOnly}} {{i18n 'admin.badges.delete'}} {{/unless}}
{{/d-section}} {{#if grant_count}}
{{#link-to 'badges.show' this}}{{i18n 'badges.granted' count=grant_count}}{{/link-to}}
{{/if}}