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

{{#link-to "adminSiteText" (query-params q=(concat textCustomizationPrefix "name"))}} {{i18n "admin.badges.read_only_setting_help"}} {{/link-to}}

{{else}} {{input type="text" name="name" value=buffered.name}} {{/if}}
{{#if imageUploaderSelected}} {{uppy-image-uploader id="badge-image-uploader" imageUrl=buffered.image_url type="badge_image" onUploadDone=(action "setImage") onUploadDeleted=(action "removeImage") class="no-repeat contain-image" }}

{{i18n "admin.badges.image_help"}}

{{else if iconSelectorSelected}} {{icon-picker name="icon" value=buffered.icon options=(hash maximum=1) onChange=(action (mut buffered.icon)) }} {{/if}}
{{combo-box name="badge_type_id" value=buffered.badge_type_id content=badgeTypes onChange=(action (mut buffered.badge_type_id)) options=(hash disabled=readOnly ) }}
{{combo-box name="badge_grouping_id" value=buffered.badge_grouping_id content=badgeGroupings class="badge-selector" nameProperty="name" onChange=(action (mut buffered.badge_grouping_id)) }} {{d-button class="btn-default" action=(route-action "editGroupings") icon="pencil-alt" }}
{{#if buffered.system}} {{textarea name="description" value=buffered.description disabled=true}}

{{#link-to "adminSiteText" (query-params q=(concat textCustomizationPrefix "description"))}} {{i18n "admin.badges.read_only_setting_help"}} {{/link-to}}

{{else}} {{textarea name="description" value=buffered.description}} {{/if}}
{{#if buffered.system}} {{textarea name="long_description" value=buffered.long_description disabled=true}}

{{#link-to "adminSiteText" (query-params q=(concat textCustomizationPrefix "long_description"))}} {{i18n "admin.badges.read_only_setting_help"}} {{/link-to}}

{{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 onChange=(action (mut buffered.trigger)) options=(hash disabled=readOnly ) }}
{{/if}} {{/if}}
{{d-button class="btn-primary" action=(action "save") type="submit" disabled=saving label="admin.badges.save"}} {{savingStatus}} {{#unless readOnly}} {{d-button action=(action "destroy") class="btn-danger" label="admin.badges.delete" }} {{/unless}}
{{/d-section}} {{#if grant_count}}
{{#link-to "badges.show" this}}{{i18n "badges.granted" count=grant_count}}{{/link-to}}
{{/if}}