discourse/app/assets/javascripts/admin/addon/templates/badges-show.hbs

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

175 lines
6.7 KiB
Handlebars
Raw Normal View History

<DSection @class="current-badge content-body">
<form class="form-horizontal">
2021-09-20 09:52:03 -04:00
<div class="control-group">
<label for="name">{{i18n "admin.badges.name"}}</label>
{{#if readOnly}}
<Input @type="text" @name="name" @value={{buffered.name}} @disabled={{true}} />
<p class="help">
<LinkTo @route="adminSiteText" @query={{hash q=(concat textCustomizationPrefix "name")}}>
{{i18n "admin.badges.read_only_setting_help"}}
</LinkTo>
</p>
{{else}}
<Input @type="text" @name="name" @value={{buffered.name}} />
{{/if}}
</div>
2021-09-20 09:52:03 -04:00
<div class="control-group">
<label for="graphic">{{i18n "admin.badges.graphic"}}</label>
2021-09-20 09:52:03 -04:00
<div class="radios inline-form full-width">
<label class="radio-label" for="badge-icon">
<RadioButton @name="badge-icon" @id="badge-icon" @value="icon" @selection={{selectedGraphicType}} @onChange={{action "changeGraphicType"}} />
<span>{{i18n "admin.badges.select_an_icon"}}</span>
</label>
<label class="radio-label" for="badge-image">
<RadioButton @name="badge-image" @id="badge-image" @value="image" @selection={{selectedGraphicType}} @onChange={{action "changeGraphicType"}} />
<span>{{i18n "admin.badges.upload_an_image"}}</span>
</label>
</div>
{{#if imageUploaderSelected}}
<UppyImageUploader @id="badge-image-uploader" @imageUrl={{buffered.image_url}} @type="badge_image" @onUploadDone={{action "setImage"}} @onUploadDeleted={{action "removeImage"}} @class="no-repeat contain-image" />
<div class="control-instructions">
<p class="help">{{i18n "admin.badges.image_help"}}</p>
</div>
{{else if iconSelectorSelected}}
<IconPicker @name="icon" @value={{buffered.icon}} @options={{hash maximum=1}} @onChange={{action (mut buffered.icon)}} />
{{/if}}
</div>
2021-09-20 09:52:03 -04:00
<div class="control-group">
<label for="badge_type_id">{{i18n "admin.badges.badge_type"}}</label>
<ComboBox @name="badge_type_id" @value={{buffered.badge_type_id}} @content={{badgeTypes}} @onChange={{action (mut buffered.badge_type_id)}} @options={{hash
disabled=readOnly
}} />
</div>
2021-09-20 09:52:03 -04:00
<div class="control-group">
<label for="badge_grouping_id">{{i18n "admin.badges.badge_grouping"}}</label>
<div class="badge-grouping-control">
<ComboBox @name="badge_grouping_id" @value={{buffered.badge_grouping_id}} @content={{badgeGroupings}} @class="badge-selector" @nameProperty="name" @onChange={{action (mut buffered.badge_grouping_id)}} />
<DButton @class="btn-default" @action={{route-action "editGroupings"}} @icon="pencil-alt" />
</div>
</div>
2021-09-20 09:52:03 -04:00
<div class="control-group">
<label for="description">{{i18n "admin.badges.description"}}</label>
{{#if buffered.system}}
<Textarea @name="description" @value={{buffered.description}} @disabled={{true}} />
<p class="help">
<LinkTo @route="adminSiteText" @query={{hash q=(concat textCustomizationPrefix "description")}}>
{{i18n "admin.badges.read_only_setting_help"}}
</LinkTo>
</p>
{{else}}
<Textarea @name="description" @value={{buffered.description}} />
{{/if}}
</div>
2021-09-20 09:52:03 -04:00
<div class="control-group">
<label for="long_description">{{i18n "admin.badges.long_description"}}</label>
{{#if buffered.system}}
<Textarea @name="long_description" @value={{buffered.long_description}} @disabled={{true}} />
<p class="help">
<LinkTo @route="adminSiteText" @query={{hash q=(concat textCustomizationPrefix "long_description")}}>
{{i18n "admin.badges.read_only_setting_help"}}
</LinkTo>
</p>
{{else}}
<Textarea @name="long_description" @value={{buffered.long_description}} />
{{/if}}
</div>
{{#if siteSettings.enable_badge_sql}}
2021-09-20 09:52:03 -04:00
<div class="control-group">
<label for="query">{{i18n "admin.badges.query"}}</label>
<AceEditor @content={{buffered.query}} @mode="sql" @disabled={{readOnly}} />
</div>
{{#if hasQuery}}
<a href {{action "preview" buffered "false"}}>{{i18n "admin.badges.preview.link_text"}}</a>
|
<a href {{action "preview" buffered "true"}}>{{i18n "admin.badges.preview.plan_text"}}</a>
{{#if preview_loading}}
{{i18n "loading"}}
{{/if}}
2021-09-20 09:52:03 -04:00
<div class="control-group">
<label>
<Input @type="checkbox" @checked={{buffered.auto_revoke}} @disabled={{readOnly}} />
{{i18n "admin.badges.auto_revoke"}}
</label>
</div>
2021-09-20 09:52:03 -04:00
<div class="control-group">
<label>
<Input @type="checkbox" @checked={{buffered.target_posts}} @disabled={{readOnly}} />
{{i18n "admin.badges.target_posts"}}
</label>
</div>
2021-09-20 09:52:03 -04:00
<div class="control-group">
<label for="trigger">{{i18n "admin.badges.trigger"}}</label>
<ComboBox @name="trigger" @value={{buffered.trigger}} @content={{badgeTriggers}} @onChange={{action (mut buffered.trigger)}} @options={{hash
disabled=readOnly
}} />
</div>
{{/if}}
{{/if}}
2021-09-20 09:52:03 -04:00
<div class="control-group">
<div>
<label>
<Input @type="checkbox" @checked={{buffered.allow_title}} />
2021-09-20 09:52:03 -04:00
{{i18n "admin.badges.allow_title"}}
</label>
</div>
2021-09-20 09:52:03 -04:00
<div>
<label>
<Input @type="checkbox" @checked={{buffered.multiple_grant}} @disabled={{readOnly}} />
2021-09-20 09:52:03 -04:00
{{i18n "admin.badges.multiple_grant"}}
</label>
</div>
2021-09-20 09:52:03 -04:00
<div>
<label>
<Input @type="checkbox" @checked={{buffered.listable}} @disabled={{readOnly}} />
2021-09-20 09:52:03 -04:00
{{i18n "admin.badges.listable"}}
</label>
</div>
2021-09-20 09:52:03 -04:00
<div>
<label>
<Input @type="checkbox" @checked={{buffered.show_posts}} @disabled={{readOnly}} />
2021-09-20 09:52:03 -04:00
{{i18n "admin.badges.show_posts"}}
</label>
</div>
2021-09-20 09:52:03 -04:00
<div>
<label>
<Input @type="checkbox" @checked={{buffered.enabled}} />
2021-09-20 09:52:03 -04:00
{{i18n "admin.badges.enabled"}}
</label>
</div>
</div>
<div class="buttons">
<DButton @class="btn-primary" @action={{action "save"}} @type="submit" @disabled={{saving}} @label="admin.badges.save" />
<span class="saving">{{savingStatus}}</span>
{{#unless readOnly}}
<DButton @action={{action "destroy"}} @class="btn-danger" @label="admin.badges.delete" />
{{/unless}}
</div>
</form>
</DSection>
{{#if grant_count}}
2018-02-14 12:26:05 -05:00
<div class="content-body current-badge-actions">
<div>
<LinkTo @route="badges.show" @model={{this}}>{{i18n "badges.granted" count=grant_count}}</LinkTo>
</div>
</div>
{{/if}}