2018-02-15 01:26:05 +08:00
|
|
|
{{#d-section class="current-badge content-body"}}
|
2014-10-18 02:27:40 +08:00
|
|
|
<form class="form-horizontal">
|
|
|
|
<div>
|
2020-04-14 14:18:49 +08:00
|
|
|
<label for="name">{{i18n "admin.badges.name"}}</label>
|
2015-12-27 06:58:54 +08:00
|
|
|
{{#if readOnly}}
|
2016-04-08 15:52:50 +08:00
|
|
|
{{input type="text" name="name" value=buffered.name disabled=true}}
|
2015-12-27 06:58:54 +08:00
|
|
|
{{else}}
|
|
|
|
{{input type="text" name="name" value=buffered.name}}
|
|
|
|
{{/if}}
|
2014-10-18 02:27:40 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
2020-04-14 14:18:49 +08:00
|
|
|
<label for="icon">{{i18n "admin.badges.icon"}}</label>
|
2020-02-05 07:41:10 +08:00
|
|
|
{{icon-picker
|
|
|
|
name="icon"
|
|
|
|
value=buffered.icon
|
|
|
|
options=(hash
|
|
|
|
maximum=1
|
|
|
|
)
|
|
|
|
onChange=(action (mut buffered.icon))
|
|
|
|
}}
|
|
|
|
|
2020-04-14 14:18:49 +08:00
|
|
|
<p class="help">{{i18n "admin.badges.icon_help"}}</p>
|
2014-10-18 02:27:40 +08:00
|
|
|
</div>
|
|
|
|
|
2014-10-21 01:15:58 +08:00
|
|
|
<div>
|
2020-04-14 14:18:49 +08:00
|
|
|
<label for="image">{{i18n "admin.badges.image"}}</label>
|
2015-12-27 06:58:54 +08:00
|
|
|
{{input type="text" name="image" value=buffered.image}}
|
2020-04-14 14:18:49 +08:00
|
|
|
<p class="help">{{i18n "admin.badges.image_help"}}</p>
|
2014-10-21 01:15:58 +08:00
|
|
|
</div>
|
|
|
|
|
2014-10-18 02:27:40 +08:00
|
|
|
<div>
|
2020-04-14 14:18:49 +08:00
|
|
|
<label for="badge_type_id">{{i18n "admin.badges.badge_type"}}</label>
|
2020-02-03 21:22:14 +08:00
|
|
|
{{combo-box
|
|
|
|
name="badge_type_id"
|
|
|
|
value=buffered.badge_type_id
|
|
|
|
content=badgeTypes
|
|
|
|
onChange=(action (mut buffered.badge_type_id))
|
|
|
|
isDisabled=readOnly
|
|
|
|
}}
|
2014-10-18 02:27:40 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
2020-04-14 14:18:49 +08:00
|
|
|
<label for="badge_grouping_id">{{i18n "admin.badges.badge_grouping"}}</label>
|
2018-11-22 23:21:15 +08:00
|
|
|
|
|
|
|
<div class="badge-grouping-control">
|
2020-02-03 21:22:14 +08:00
|
|
|
{{combo-box
|
|
|
|
name="badge_grouping_id"
|
2018-11-22 23:21:15 +08:00
|
|
|
value=buffered.badge_grouping_id
|
|
|
|
content=badgeGroupings
|
|
|
|
class="badge-selector"
|
2020-02-03 21:22:14 +08:00
|
|
|
nameProperty="name"
|
|
|
|
onChange=(action (mut buffered.badge_grouping_id))
|
|
|
|
}}
|
2019-11-04 18:23:54 +08:00
|
|
|
{{d-button
|
|
|
|
class="btn-default"
|
|
|
|
action=(route-action "editGroupings")
|
2020-02-04 22:02:40 +08:00
|
|
|
icon="pencil-alt"
|
2020-02-03 21:22:14 +08:00
|
|
|
}}
|
2018-11-22 23:21:15 +08:00
|
|
|
</div>
|
2014-10-18 02:27:40 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
2020-04-14 14:18:49 +08:00
|
|
|
<label for="description">{{i18n "admin.badges.description"}}</label>
|
2016-03-28 15:38:38 +08:00
|
|
|
{{#if buffered.system}}
|
2016-04-08 15:52:50 +08:00
|
|
|
{{textarea name="description" value=buffered.description disabled=true}}
|
2016-03-28 15:38:38 +08:00
|
|
|
{{else}}
|
2014-10-18 02:27:40 +08:00
|
|
|
{{textarea name="description" value=buffered.description}}
|
2016-03-28 15:38:38 +08:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
2020-04-14 14:18:49 +08:00
|
|
|
<label for="long_description">{{i18n "admin.badges.long_description"}}</label>
|
2016-03-28 15:38:38 +08:00
|
|
|
{{#if buffered.system}}
|
|
|
|
{{textarea name="long_description" value=buffered.long_description disabled=true}}
|
2014-10-18 02:27:40 +08:00
|
|
|
{{else}}
|
2016-03-28 15:38:38 +08:00
|
|
|
{{textarea name="long_description" value=buffered.long_description}}
|
2014-10-18 02:27:40 +08:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
|
2016-07-28 07:03:00 +08:00
|
|
|
{{#if siteSettings.enable_badge_sql}}
|
2014-10-18 02:27:40 +08:00
|
|
|
<div>
|
2020-04-14 14:18:49 +08:00
|
|
|
<label for="query">{{i18n "admin.badges.query"}}</label>
|
2017-10-30 15:07:49 +08:00
|
|
|
{{ace-editor content=buffered.query mode="sql" disabled=readOnly}}
|
2014-10-18 02:27:40 +08:00
|
|
|
</div>
|
|
|
|
|
2016-07-28 07:03:00 +08:00
|
|
|
{{#if hasQuery}}
|
2020-04-14 14:18:49 +08:00
|
|
|
<a href {{action "preview" buffered "false"}}>{{i18n "admin.badges.preview.link_text"}}</a>
|
2016-07-28 07:03:00 +08:00
|
|
|
|
|
2020-04-14 14:18:49 +08:00
|
|
|
<a href {{action "preview" buffered "true"}}>{{i18n "admin.badges.preview.plan_text"}}</a>
|
2016-07-28 07:03:00 +08:00
|
|
|
{{#if preview_loading}}
|
2020-04-14 14:18:49 +08:00
|
|
|
{{i18n "loading"}}...
|
2016-07-28 07:03:00 +08:00
|
|
|
{{/if}}
|
2014-10-18 02:27:40 +08:00
|
|
|
|
2016-07-28 07:03:00 +08:00
|
|
|
<div>
|
|
|
|
<label>
|
|
|
|
{{input type="checkbox" checked=buffered.auto_revoke disabled=readOnly}}
|
2020-04-14 14:18:49 +08:00
|
|
|
{{i18n "admin.badges.auto_revoke"}}
|
2016-07-28 07:03:00 +08:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<label>
|
|
|
|
{{input type="checkbox" checked=buffered.target_posts disabled=readOnly}}
|
2020-04-14 14:18:49 +08:00
|
|
|
{{i18n "admin.badges.target_posts"}}
|
2016-07-28 07:03:00 +08:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
2020-04-14 14:18:49 +08:00
|
|
|
<label for="trigger">{{i18n "admin.badges.trigger"}}</label>
|
2020-02-03 21:22:14 +08:00
|
|
|
{{combo-box
|
|
|
|
name="trigger"
|
|
|
|
value=buffered.trigger
|
|
|
|
content=badgeTriggers
|
|
|
|
onChange=(action (mut buffered.trigger))
|
|
|
|
disabled=readOnly
|
|
|
|
}}
|
2016-07-28 07:03:00 +08:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
2014-10-18 02:27:40 +08:00
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<label>
|
|
|
|
{{input type="checkbox" checked=buffered.allow_title}}
|
2020-04-14 14:18:49 +08:00
|
|
|
{{i18n "admin.badges.allow_title"}}
|
2014-10-18 02:27:40 +08:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<label>
|
|
|
|
{{input type="checkbox" checked=buffered.multiple_grant disabled=readOnly}}
|
2020-04-14 14:18:49 +08:00
|
|
|
{{i18n "admin.badges.multiple_grant"}}
|
2014-10-18 02:27:40 +08:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<label>
|
|
|
|
{{input type="checkbox" checked=buffered.listable disabled=readOnly}}
|
2020-04-14 14:18:49 +08:00
|
|
|
{{i18n "admin.badges.listable"}}
|
2014-10-18 02:27:40 +08:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<label>
|
|
|
|
{{input type="checkbox" checked=buffered.show_posts disabled=readOnly}}
|
2020-04-14 14:18:49 +08:00
|
|
|
{{i18n "admin.badges.show_posts"}}
|
2014-10-18 02:27:40 +08:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<label>
|
|
|
|
{{input type="checkbox" checked=buffered.enabled}}
|
2020-04-14 14:18:49 +08:00
|
|
|
{{i18n "admin.badges.enabled"}}
|
2014-10-18 02:27:40 +08:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
2020-04-14 14:18:49 +08:00
|
|
|
<div class="buttons">
|
2019-11-04 18:23:54 +08:00
|
|
|
{{d-button
|
|
|
|
class="btn-primary"
|
|
|
|
action=(action "save")
|
2020-02-05 22:23:35 +08:00
|
|
|
type="submit"
|
2019-11-04 18:23:54 +08:00
|
|
|
disabled=saving
|
|
|
|
label="admin.badges.save"}}
|
2020-04-14 14:18:49 +08:00
|
|
|
<span class="saving">{{savingStatus}}</span>
|
2014-10-18 02:27:40 +08:00
|
|
|
{{#unless readOnly}}
|
2020-02-11 22:55:16 +08:00
|
|
|
{{d-button
|
|
|
|
action=(action "destroy")
|
|
|
|
class="btn-danger"
|
|
|
|
label="admin.badges.delete"
|
|
|
|
}}
|
2014-10-18 02:27:40 +08:00
|
|
|
{{/unless}}
|
|
|
|
</div>
|
|
|
|
</form>
|
2016-11-11 03:35:53 +08:00
|
|
|
{{/d-section}}
|
2014-10-18 02:27:40 +08:00
|
|
|
|
|
|
|
{{#if grant_count}}
|
2018-02-15 01:26:05 +08:00
|
|
|
<div class="content-body current-badge-actions">
|
2014-10-18 02:27:40 +08:00
|
|
|
<div>
|
2020-04-14 14:18:49 +08:00
|
|
|
{{#link-to "badges.show" this}}{{i18n "badges.granted" count=grant_count}}{{/link-to}}
|
2014-10-18 02:27:40 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|