2022-06-30 06:30:50 -04:00
|
|
|
<DSection @class="current-badge content-body">
|
2014-10-17 14:27:40 -04:00
|
|
|
<form class="form-horizontal">
|
2021-09-20 09:52:03 -04:00
|
|
|
<div class="control-group">
|
2014-12-08 16:35:49 -05:00
|
|
|
<label for="name">{{i18n "admin.badges.name"}}</label>
|
2015-12-26 17:58:54 -05:00
|
|
|
{{#if readOnly}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<Input @type="text" @name="name" @value={{buffered.name}} @disabled={{true}} />
|
2020-12-08 14:55:49 -05:00
|
|
|
<p class="help">
|
2022-06-30 06:30:50 -04:00
|
|
|
<LinkTo @route="adminSiteText" @query={{hash q=(concat textCustomizationPrefix "name")}}>
|
2020-12-08 14:55:49 -05:00
|
|
|
{{i18n "admin.badges.read_only_setting_help"}}
|
2022-06-30 06:30:50 -04:00
|
|
|
</LinkTo>
|
2020-12-08 14:55:49 -05:00
|
|
|
</p>
|
2015-12-26 17:58:54 -05:00
|
|
|
{{else}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<Input @type="text" @name="name" @value={{buffered.name}} />
|
2015-12-26 17:58:54 -05:00
|
|
|
{{/if}}
|
2014-10-17 14:27:40 -04:00
|
|
|
</div>
|
|
|
|
|
2021-09-20 09:52:03 -04:00
|
|
|
<div class="control-group">
|
2021-03-17 01:55:23 -04:00
|
|
|
<label for="graphic">{{i18n "admin.badges.graphic"}}</label>
|
2021-09-20 09:52:03 -04:00
|
|
|
<div class="radios inline-form full-width">
|
2021-03-17 01:55:23 -04:00
|
|
|
<label class="radio-label" for="badge-icon">
|
2022-06-30 06:30:50 -04:00
|
|
|
<RadioButton @name="badge-icon" @id="badge-icon" @value="icon" @selection={{selectedGraphicType}} @onChange={{action "changeGraphicType"}} />
|
2021-03-17 01:55:23 -04:00
|
|
|
<span>{{i18n "admin.badges.select_an_icon"}}</span>
|
|
|
|
</label>
|
2014-10-17 14:27:40 -04:00
|
|
|
|
2021-03-17 01:55:23 -04:00
|
|
|
<label class="radio-label" for="badge-image">
|
2022-06-30 06:30:50 -04:00
|
|
|
<RadioButton @name="badge-image" @id="badge-image" @value="image" @selection={{selectedGraphicType}} @onChange={{action "changeGraphicType"}} />
|
2021-03-17 01:55:23 -04:00
|
|
|
<span>{{i18n "admin.badges.upload_an_image"}}</span>
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
{{#if imageUploaderSelected}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<UppyImageUploader @id="badge-image-uploader" @imageUrl={{buffered.image_url}} @type="badge_image" @onUploadDone={{action "setImage"}} @onUploadDeleted={{action "removeImage"}} @class="no-repeat contain-image" />
|
2021-03-17 01:55:23 -04:00
|
|
|
<div class="control-instructions">
|
|
|
|
<p class="help">{{i18n "admin.badges.image_help"}}</p>
|
|
|
|
</div>
|
|
|
|
{{else if iconSelectorSelected}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<IconPicker @name="icon" @value={{buffered.icon}} @options={{hash maximum=1}} @onChange={{action (mut buffered.icon)}} />
|
2021-03-17 01:55:23 -04:00
|
|
|
{{/if}}
|
2014-10-20 13:15:58 -04:00
|
|
|
</div>
|
|
|
|
|
2021-09-20 09:52:03 -04:00
|
|
|
<div class="control-group">
|
2014-12-08 16:35:49 -05:00
|
|
|
<label for="badge_type_id">{{i18n "admin.badges.badge_type"}}</label>
|
2022-06-30 06:30:50 -04:00
|
|
|
<ComboBox @name="badge_type_id" @value={{buffered.badge_type_id}} @content={{badgeTypes}} @onChange={{action (mut buffered.badge_type_id)}} @options={{hash
|
2022-04-05 13:01:09 -04:00
|
|
|
disabled=readOnly
|
2022-06-30 06:30:50 -04:00
|
|
|
}} />
|
2014-10-17 14:27:40 -04:00
|
|
|
</div>
|
|
|
|
|
2021-09-20 09:52:03 -04:00
|
|
|
<div class="control-group">
|
2014-12-08 16:35:49 -05:00
|
|
|
<label for="badge_grouping_id">{{i18n "admin.badges.badge_grouping"}}</label>
|
2018-11-22 10:21:15 -05:00
|
|
|
|
|
|
|
<div class="badge-grouping-control">
|
2022-06-30 06:30:50 -04:00
|
|
|
<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" />
|
2018-11-22 10:21:15 -05:00
|
|
|
</div>
|
2014-10-17 14:27:40 -04:00
|
|
|
</div>
|
|
|
|
|
2021-09-20 09:52:03 -04:00
|
|
|
<div class="control-group">
|
2014-12-08 16:35:49 -05:00
|
|
|
<label for="description">{{i18n "admin.badges.description"}}</label>
|
2016-03-28 03:38:38 -04:00
|
|
|
{{#if buffered.system}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<Textarea @name="description" @value={{buffered.description}} @disabled={{true}} />
|
2020-12-08 14:55:49 -05:00
|
|
|
<p class="help">
|
2022-06-30 06:30:50 -04:00
|
|
|
<LinkTo @route="adminSiteText" @query={{hash q=(concat textCustomizationPrefix "description")}}>
|
2020-12-08 14:55:49 -05:00
|
|
|
{{i18n "admin.badges.read_only_setting_help"}}
|
2022-06-30 06:30:50 -04:00
|
|
|
</LinkTo>
|
2020-12-08 14:55:49 -05:00
|
|
|
</p>
|
2016-03-28 03:38:38 -04:00
|
|
|
{{else}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<Textarea @name="description" @value={{buffered.description}} />
|
2016-03-28 03:38:38 -04:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
|
2021-09-20 09:52:03 -04:00
|
|
|
<div class="control-group">
|
2016-03-28 03:38:38 -04:00
|
|
|
<label for="long_description">{{i18n "admin.badges.long_description"}}</label>
|
|
|
|
{{#if buffered.system}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<Textarea @name="long_description" @value={{buffered.long_description}} @disabled={{true}} />
|
2020-12-08 14:55:49 -05:00
|
|
|
<p class="help">
|
2022-06-30 06:30:50 -04:00
|
|
|
<LinkTo @route="adminSiteText" @query={{hash q=(concat textCustomizationPrefix "long_description")}}>
|
2020-12-08 14:55:49 -05:00
|
|
|
{{i18n "admin.badges.read_only_setting_help"}}
|
2022-06-30 06:30:50 -04:00
|
|
|
</LinkTo>
|
2020-12-08 14:55:49 -05:00
|
|
|
</p>
|
2014-10-17 14:27:40 -04:00
|
|
|
{{else}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<Textarea @name="long_description" @value={{buffered.long_description}} />
|
2014-10-17 14:27:40 -04:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
|
2016-07-27 19:03:00 -04:00
|
|
|
{{#if siteSettings.enable_badge_sql}}
|
2021-09-20 09:52:03 -04:00
|
|
|
<div class="control-group">
|
2016-07-27 19:03:00 -04:00
|
|
|
<label for="query">{{i18n "admin.badges.query"}}</label>
|
2022-06-30 06:30:50 -04:00
|
|
|
<AceEditor @content={{buffered.query}} @mode="sql" @disabled={{readOnly}} />
|
2014-10-17 14:27:40 -04:00
|
|
|
</div>
|
|
|
|
|
2016-07-27 19:03:00 -04:00
|
|
|
{{#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}}
|
2020-09-15 09:22:46 -04:00
|
|
|
{{i18n "loading"}}
|
2016-07-27 19:03:00 -04:00
|
|
|
{{/if}}
|
2014-10-17 14:27:40 -04:00
|
|
|
|
2021-09-20 09:52:03 -04:00
|
|
|
<div class="control-group">
|
2016-07-27 19:03:00 -04:00
|
|
|
<label>
|
2022-06-30 06:30:50 -04:00
|
|
|
<Input @type="checkbox" @checked={{buffered.auto_revoke}} @disabled={{readOnly}} />
|
2016-07-27 19:03:00 -04:00
|
|
|
{{i18n "admin.badges.auto_revoke"}}
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
2021-09-20 09:52:03 -04:00
|
|
|
<div class="control-group">
|
2016-07-27 19:03:00 -04:00
|
|
|
<label>
|
2022-06-30 06:30:50 -04:00
|
|
|
<Input @type="checkbox" @checked={{buffered.target_posts}} @disabled={{readOnly}} />
|
2016-07-27 19:03:00 -04:00
|
|
|
{{i18n "admin.badges.target_posts"}}
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
2021-09-20 09:52:03 -04:00
|
|
|
<div class="control-group">
|
2016-07-27 19:03:00 -04:00
|
|
|
<label for="trigger">{{i18n "admin.badges.trigger"}}</label>
|
2022-06-30 06:30:50 -04:00
|
|
|
<ComboBox @name="trigger" @value={{buffered.trigger}} @content={{badgeTriggers}} @onChange={{action (mut buffered.trigger)}} @options={{hash
|
2022-04-05 13:01:09 -04:00
|
|
|
disabled=readOnly
|
2022-06-30 06:30:50 -04:00
|
|
|
}} />
|
2016-07-27 19:03:00 -04:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
2014-10-17 14:27:40 -04:00
|
|
|
{{/if}}
|
|
|
|
|
2021-09-20 09:52:03 -04:00
|
|
|
<div class="control-group">
|
|
|
|
<div>
|
|
|
|
<label>
|
2022-06-30 06:30:50 -04:00
|
|
|
<Input @type="checkbox" @checked={{buffered.allow_title}} />
|
2021-09-20 09:52:03 -04:00
|
|
|
{{i18n "admin.badges.allow_title"}}
|
|
|
|
</label>
|
|
|
|
</div>
|
2014-10-17 14:27:40 -04:00
|
|
|
|
2021-09-20 09:52:03 -04:00
|
|
|
<div>
|
|
|
|
<label>
|
2022-06-30 06:30:50 -04:00
|
|
|
<Input @type="checkbox" @checked={{buffered.multiple_grant}} @disabled={{readOnly}} />
|
2021-09-20 09:52:03 -04:00
|
|
|
{{i18n "admin.badges.multiple_grant"}}
|
|
|
|
</label>
|
|
|
|
</div>
|
2014-10-17 14:27:40 -04:00
|
|
|
|
2021-09-20 09:52:03 -04:00
|
|
|
<div>
|
|
|
|
<label>
|
2022-06-30 06:30:50 -04:00
|
|
|
<Input @type="checkbox" @checked={{buffered.listable}} @disabled={{readOnly}} />
|
2021-09-20 09:52:03 -04:00
|
|
|
{{i18n "admin.badges.listable"}}
|
|
|
|
</label>
|
|
|
|
</div>
|
2014-10-17 14:27:40 -04:00
|
|
|
|
2021-09-20 09:52:03 -04:00
|
|
|
<div>
|
|
|
|
<label>
|
2022-06-30 06:30:50 -04:00
|
|
|
<Input @type="checkbox" @checked={{buffered.show_posts}} @disabled={{readOnly}} />
|
2021-09-20 09:52:03 -04:00
|
|
|
{{i18n "admin.badges.show_posts"}}
|
|
|
|
</label>
|
|
|
|
</div>
|
2014-10-17 14:27:40 -04:00
|
|
|
|
2021-09-20 09:52:03 -04:00
|
|
|
<div>
|
|
|
|
<label>
|
2022-06-30 06:30:50 -04:00
|
|
|
<Input @type="checkbox" @checked={{buffered.enabled}} />
|
2021-09-20 09:52:03 -04:00
|
|
|
{{i18n "admin.badges.enabled"}}
|
|
|
|
</label>
|
|
|
|
</div>
|
2014-10-17 14:27:40 -04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="buttons">
|
2022-06-30 06:30:50 -04:00
|
|
|
<DButton @class="btn-primary" @action={{action "save"}} @type="submit" @disabled={{saving}} @label="admin.badges.save" />
|
2014-10-17 14:27:40 -04:00
|
|
|
<span class="saving">{{savingStatus}}</span>
|
|
|
|
{{#unless readOnly}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<DButton @action={{action "destroy"}} @class="btn-danger" @label="admin.badges.delete" />
|
2014-10-17 14:27:40 -04:00
|
|
|
{{/unless}}
|
|
|
|
</div>
|
|
|
|
</form>
|
2022-06-30 06:30:50 -04:00
|
|
|
</DSection>
|
2014-10-17 14:27:40 -04:00
|
|
|
|
|
|
|
{{#if grant_count}}
|
2018-02-14 12:26:05 -05:00
|
|
|
<div class="content-body current-badge-actions">
|
2014-10-17 14:27:40 -04:00
|
|
|
<div>
|
2022-06-30 06:30:50 -04:00
|
|
|
<LinkTo @route="badges.show" @model={{this}}>{{i18n "badges.granted" count=grant_count}}</LinkTo>
|
2014-10-17 14:27:40 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|