2018-02-14 12:26:05 -05:00
|
|
|
{{#d-section 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}}
|
2016-04-08 03:52:50 -04:00
|
|
|
{{input type="text" name="name" value=buffered.name disabled=true}}
|
2020-12-08 14:55:49 -05:00
|
|
|
<p class="help">
|
2021-01-25 15:45:13 -05:00
|
|
|
{{#link-to "adminSiteText" (query-params q=(concat textCustomizationPrefix "name"))}}
|
2020-12-08 14:55:49 -05:00
|
|
|
{{i18n "admin.badges.read_only_setting_help"}}
|
|
|
|
{{/link-to}}
|
|
|
|
</p>
|
2015-12-26 17:58:54 -05:00
|
|
|
{{else}}
|
|
|
|
{{input type="text" name="name" value=buffered.name}}
|
|
|
|
{{/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">
|
|
|
|
{{radio-button
|
|
|
|
name="badge-icon"
|
|
|
|
id="badge-icon"
|
|
|
|
value="icon"
|
|
|
|
selection=selectedGraphicType
|
|
|
|
onChange=(action "changeGraphicType")
|
|
|
|
}}
|
|
|
|
<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">
|
|
|
|
{{radio-button
|
|
|
|
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}}
|
|
|
|
{{image-uploader
|
|
|
|
imageUrl=buffered.image_url
|
|
|
|
onUploadDone=(action "setImage")
|
|
|
|
onUploadDeleted=(action "removeImage")
|
|
|
|
type="badge_image"
|
|
|
|
class="no-repeat contain-image"}}
|
|
|
|
<div class="control-instructions">
|
|
|
|
<p class="help">{{i18n "admin.badges.image_help"}}</p>
|
|
|
|
</div>
|
|
|
|
{{else if iconSelectorSelected}}
|
|
|
|
{{icon-picker
|
|
|
|
name="icon"
|
|
|
|
value=buffered.icon
|
|
|
|
options=(hash maximum=1)
|
|
|
|
onChange=(action (mut buffered.icon))
|
|
|
|
}}
|
|
|
|
{{/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>
|
2020-02-03 08:22:14 -05:00
|
|
|
{{combo-box
|
|
|
|
name="badge_type_id"
|
|
|
|
value=buffered.badge_type_id
|
|
|
|
content=badgeTypes
|
2020-10-06 17:50:05 -04:00
|
|
|
onChange=(action (mut buffered.badge_type_id))
|
2020-02-03 08:22:14 -05:00
|
|
|
isDisabled=readOnly
|
|
|
|
}}
|
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">
|
2020-02-03 08:22:14 -05:00
|
|
|
{{combo-box
|
|
|
|
name="badge_grouping_id"
|
2018-11-22 10:21:15 -05:00
|
|
|
value=buffered.badge_grouping_id
|
|
|
|
content=badgeGroupings
|
|
|
|
class="badge-selector"
|
2020-02-03 08:22:14 -05:00
|
|
|
nameProperty="name"
|
2020-10-06 17:50:05 -04:00
|
|
|
onChange=(action (mut buffered.badge_grouping_id))
|
2020-02-03 08:22:14 -05:00
|
|
|
}}
|
2019-11-04 05:23:54 -05:00
|
|
|
{{d-button
|
|
|
|
class="btn-default"
|
|
|
|
action=(route-action "editGroupings")
|
2020-02-04 09:02:40 -05:00
|
|
|
icon="pencil-alt"
|
2020-02-03 08:22:14 -05:00
|
|
|
}}
|
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}}
|
2016-04-08 03:52:50 -04:00
|
|
|
{{textarea name="description" value=buffered.description disabled=true}}
|
2020-12-08 14:55:49 -05:00
|
|
|
<p class="help">
|
2021-01-25 15:45:13 -05:00
|
|
|
{{#link-to "adminSiteText" (query-params q=(concat textCustomizationPrefix "description"))}}
|
2020-12-08 14:55:49 -05:00
|
|
|
{{i18n "admin.badges.read_only_setting_help"}}
|
|
|
|
{{/link-to}}
|
|
|
|
</p>
|
2016-03-28 03:38:38 -04:00
|
|
|
{{else}}
|
2014-10-17 14:27:40 -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}}
|
|
|
|
{{textarea name="long_description" value=buffered.long_description disabled=true}}
|
2020-12-08 14:55:49 -05:00
|
|
|
<p class="help">
|
2021-01-25 15:45:13 -05:00
|
|
|
{{#link-to "adminSiteText" (query-params q=(concat textCustomizationPrefix "long_description"))}}
|
2020-12-08 14:55:49 -05:00
|
|
|
{{i18n "admin.badges.read_only_setting_help"}}
|
|
|
|
{{/link-to}}
|
|
|
|
</p>
|
2014-10-17 14:27:40 -04:00
|
|
|
{{else}}
|
2016-03-28 03:38:38 -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>
|
2017-10-30 03:07:49 -04:00
|
|
|
{{ace-editor 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>
|
|
|
|
{{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">
|
2016-07-27 19:03:00 -04:00
|
|
|
<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">
|
2016-07-27 19:03:00 -04:00
|
|
|
<label for="trigger">{{i18n "admin.badges.trigger"}}</label>
|
2020-02-03 08:22:14 -05:00
|
|
|
{{combo-box
|
|
|
|
name="trigger"
|
|
|
|
value=buffered.trigger
|
|
|
|
content=badgeTriggers
|
2020-10-06 17:50:05 -04:00
|
|
|
onChange=(action (mut buffered.trigger))
|
2020-02-03 08:22:14 -05:00
|
|
|
disabled=readOnly
|
|
|
|
}}
|
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>
|
|
|
|
{{input type="checkbox" checked=buffered.allow_title}}
|
|
|
|
{{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>
|
|
|
|
{{input type="checkbox" checked=buffered.multiple_grant disabled=readOnly}}
|
|
|
|
{{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>
|
|
|
|
{{input type="checkbox" checked=buffered.listable disabled=readOnly}}
|
|
|
|
{{i18n "admin.badges.listable"}}
|
|
|
|
</label>
|
|
|
|
</div>
|
2014-10-17 14:27:40 -04:00
|
|
|
|
2021-09-20 09:52:03 -04:00
|
|
|
<div>
|
|
|
|
<label>
|
|
|
|
{{input type="checkbox" checked=buffered.show_posts disabled=readOnly}}
|
|
|
|
{{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>
|
|
|
|
{{input type="checkbox" checked=buffered.enabled}}
|
|
|
|
{{i18n "admin.badges.enabled"}}
|
|
|
|
</label>
|
|
|
|
</div>
|
2014-10-17 14:27:40 -04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="buttons">
|
2019-11-04 05:23:54 -05:00
|
|
|
{{d-button
|
|
|
|
class="btn-primary"
|
|
|
|
action=(action "save")
|
2020-02-05 09:23:35 -05:00
|
|
|
type="submit"
|
2019-11-04 05:23:54 -05:00
|
|
|
disabled=saving
|
|
|
|
label="admin.badges.save"}}
|
2014-10-17 14:27:40 -04:00
|
|
|
<span class="saving">{{savingStatus}}</span>
|
|
|
|
{{#unless readOnly}}
|
2020-02-11 09:55:16 -05:00
|
|
|
{{d-button
|
|
|
|
action=(action "destroy")
|
|
|
|
class="btn-danger"
|
|
|
|
label="admin.badges.delete"
|
|
|
|
}}
|
2014-10-17 14:27:40 -04:00
|
|
|
{{/unless}}
|
|
|
|
</div>
|
|
|
|
</form>
|
2016-11-10 14:35:53 -05:00
|
|
|
{{/d-section}}
|
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>
|
2014-12-08 16:35:49 -05:00
|
|
|
{{#link-to "badges.show" this}}{{i18n "badges.granted" count=grant_count}}{{/link-to}}
|
2014-10-17 14:27:40 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|