1
0
Fork 0
discourse-custom-wizard-unl.../assets/javascripts/discourse/templates/components/wizard-custom-action.hbs

346 Zeilen
9,2 KiB
Handlebars

2017-10-06 04:59:02 +02:00
<div class="setting">
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n "admin.wizard.type"}}</label>
2017-10-06 04:59:02 +02:00
</div>
2020-03-29 09:49:33 +02:00
2017-10-06 04:59:02 +02:00
<div class="setting-value">
2020-02-02 11:42:05 +01:00
{{combo-box
value=action.type
content=types
2020-03-29 09:49:33 +02:00
onChange=(action (mut action.type))
2020-03-22 07:47:56 +01:00
options=(hash
none="admin.wizard.field.type"
)}}
2017-10-06 04:59:02 +02:00
</div>
</div>
2019-08-27 08:05:24 +02:00
{{#if basicTopicFields}}
2017-10-06 04:59:02 +02:00
<div class="setting">
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n "admin.wizard.action.title"}}</label>
2017-10-06 04:59:02 +02:00
</div>
2020-03-29 09:49:33 +02:00
2017-10-06 04:59:02 +02:00
<div class="setting-value">
2020-02-02 11:42:05 +01:00
{{combo-box
value=action.title
2020-03-21 18:30:11 +01:00
content=wizardFields
2020-02-02 11:42:05 +01:00
nameProperty="label"
2020-03-29 09:49:33 +02:00
onChange=(action (mut action.title))
2020-03-22 07:47:56 +01:00
options=(hash
none='admin.wizard.select_field'
2020-03-29 09:49:33 +02:00
isDisabled=action.custom_title_enabled
2020-03-22 07:47:56 +01:00
)}}
2020-03-29 09:49:33 +02:00
<div class="setting-gutter">
{{input type='checkbox' checked=action.custom_title_enabled}}
<span>{{i18n 'admin.wizard.action.custom_title'}}</span>
{{#if action.custom_title_enabled}}
{{input value=action.custom_title}}
{{/if}}
</div>
2017-10-06 04:59:02 +02:00
</div>
</div>
<div class="setting">
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n "admin.wizard.action.post"}}</label>
2017-10-06 04:59:02 +02:00
</div>
2020-03-29 09:49:33 +02:00
2017-10-06 04:59:02 +02:00
<div class="setting-value">
2020-02-02 11:42:05 +01:00
{{combo-box
value=action.post
2020-03-21 18:30:11 +01:00
content=wizardFields
2020-02-02 11:42:05 +01:00
nameProperty='label'
2020-03-29 09:49:33 +02:00
onChange=(action (mut action.post))
2020-03-22 07:47:56 +01:00
options=(hash
none='admin.wizard.select_field'
2020-03-29 09:49:33 +02:00
isDisabled=action.post_builder
2020-03-22 07:47:56 +01:00
)}}
2020-03-29 09:49:33 +02:00
<div class="setting-gutter">
2017-11-24 05:32:15 +01:00
{{input type='checkbox' checked=action.post_builder}}
<span>{{i18n 'admin.wizard.action.post_builder.checkbox'}}</span>
</div>
2017-10-17 09:18:53 +02:00
</div>
</div>
2017-11-24 05:32:15 +01:00
{{#if action.post_builder}}
<div class="setting full">
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n 'admin.wizard.action.post_builder.label'}}</label>
2017-11-24 05:32:15 +01:00
</div>
2020-03-29 09:49:33 +02:00
2019-08-27 08:05:24 +02:00
<div class="setting-value editor">
2020-03-29 09:49:33 +02:00
{{wizard-text-editor
2020-03-21 18:30:11 +01:00
value=action.post_template
2020-03-29 09:49:33 +02:00
wizardFields=wizardFields}}
2017-11-24 05:32:15 +01:00
</div>
</div>
{{/if}}
2019-08-27 08:05:24 +02:00
{{/if}}
2017-11-24 05:32:15 +01:00
2019-08-27 08:05:24 +02:00
{{#if publicTopicFields}}
2018-09-18 03:56:42 +02:00
<div class="setting">
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n "admin.wizard.action.create_topic.category"}}</label>
2018-09-18 03:56:42 +02:00
</div>
2020-03-29 09:49:33 +02:00
2018-09-18 03:56:42 +02:00
<div class="setting-value">
2020-02-02 11:42:05 +01:00
{{category-chooser
value=action.category_id
isDisabled=action.custom_category_enabled}}
2020-03-29 09:49:33 +02:00
2019-08-27 08:05:24 +02:00
<div class="setting-gutter">
{{input type='checkbox' checked=action.custom_category_enabled}}
<span>{{i18n 'admin.wizard.action.custom_category.label'}}</span>
2020-03-29 09:49:33 +02:00
2019-08-27 08:05:24 +02:00
{{#if action.custom_category_enabled}}
<div class="custom-category">
<div>
{{input type='checkbox' checked=action.custom_category_wizard_field}}
2020-03-24 11:22:32 +01:00
<span>{{i18n 'admin.wizard.wizard_field'}}</span>
2019-08-27 08:05:24 +02:00
{{#if action.custom_category_wizard_field}}
2020-02-02 11:42:05 +01:00
{{combo-box
value=action.category_id
content=categoryFields
nameProperty="label"
2020-03-29 09:49:33 +02:00
onChange=(action (mut action.category_id))
2020-03-22 07:47:56 +01:00
options=(hash
none='admin.wizard.select_field'
)}}
2019-08-27 08:05:24 +02:00
{{/if}}
</div>
2020-03-29 09:49:33 +02:00
2019-08-27 08:05:24 +02:00
<div>
{{input type='checkbox' checked=action.custom_category_user_field}}
<span>{{i18n 'admin.wizard.action.custom_category.user_field'}}</span>
{{#if action.custom_category_user_field}}
{{input value=action.custom_category_user_field_key}}
{{/if}}
</div>
</div>
{{/if}}
</div>
2018-09-18 03:56:42 +02:00
</div>
</div>
2019-08-27 08:05:24 +02:00
2017-10-06 04:59:02 +02:00
<div class="setting">
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n "admin.wizard.action.create_topic.tags"}}</label>
2017-10-06 04:59:02 +02:00
</div>
2020-03-21 18:30:11 +01:00
2017-10-06 04:59:02 +02:00
<div class="setting-value">
2020-02-02 11:42:05 +01:00
{{tag-chooser
tags=action.tags
filterable=true
allowCreate=true
isDisabled=action.custom_tag_enabled}}
2020-03-21 18:30:11 +01:00
<div class="setting-gutter">
{{input type='checkbox' checked=action.custom_tag_enabled}}
<span>{{i18n 'admin.wizard.action.custom_tag.label'}}</span>
2020-03-29 09:49:33 +02:00
{{#if action.custom_tag_enabled}}
<div class="custom-tag">
2020-02-02 11:42:05 +01:00
{{combo-box
value=action.custom_tag_field
content=tagFields
nameProperty="label"
2020-03-29 09:49:33 +02:00
onChange=(action (mut action.custom_tag_field))
2020-03-22 07:47:56 +01:00
options=(hash
none='admin.wizard.select_field'
)}}
</div>
{{/if}}
</div>
2017-10-06 04:59:02 +02:00
</div>
</div>
2019-08-27 08:05:24 +02:00
{{/if}}
2017-10-17 09:18:53 +02:00
2019-08-27 08:05:24 +02:00
{{#if newTopicFields}}
2017-10-06 04:59:02 +02:00
<div class="setting">
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n "admin.wizard.action.skip_redirect.label"}}</label>
2017-10-06 04:59:02 +02:00
</div>
2020-03-29 09:49:33 +02:00
2017-10-06 04:59:02 +02:00
<div class="setting-value">
2019-08-27 08:05:24 +02:00
{{input type='checkbox' checked=action.skip_redirect}}
2020-03-29 09:49:33 +02:00
<span>
{{i18n 'admin.wizard.action.skip_redirect.description' type='topic'}}
</span>
2017-10-06 04:59:02 +02:00
</div>
</div>
2019-08-27 08:05:24 +02:00
{{/if}}
2017-10-17 09:18:53 +02:00
2019-08-27 08:05:24 +02:00
{{#if createTopic}}
2020-03-29 09:49:33 +02:00
<div class="setting full field-mapper-setting">
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n 'admin.wizard.action.add_fields'}}</label>
2020-03-29 09:49:33 +02:00
</div>
<div class="setting-value">
{{wizard-field-mapper
inputs=action.add_fields
wizardFields=wizardFields
options=(hash
wizardFieldSelection=true
)}}
</div>
2019-08-27 08:05:24 +02:00
</div>
{{/if}}
2017-11-24 05:32:15 +01:00
2019-08-27 08:05:24 +02:00
{{#if sendMessage}}
<div class="setting">
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n 'admin.wizard.required'}}</label>
</div>
2020-03-21 18:30:11 +01:00
<div class="setting-value">
2020-02-02 11:42:05 +01:00
{{combo-box
value=action.required
2020-03-21 18:30:11 +01:00
content=wizardFields
2020-02-02 11:42:05 +01:00
nameProperty='label'
2020-03-29 09:49:33 +02:00
onChange=(action (mut action.required))
2020-03-22 07:47:56 +01:00
options=(hash
none='admin.wizard.select_field'
)}}
</div>
</div>
2020-03-21 18:30:11 +01:00
2017-10-06 04:59:02 +02:00
<div class="setting">
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n "admin.wizard.action.send_message.recipient"}}</label>
2017-10-06 04:59:02 +02:00
</div>
2020-03-29 09:49:33 +02:00
2017-10-06 04:59:02 +02:00
<div class="setting-value">
2020-03-21 18:30:11 +01:00
{{user-selector
single="true"
includeMentionableGroups="true"
usernames=action.username
allowedUsers="true"}}
2017-10-06 04:59:02 +02:00
</div>
</div>
2017-10-22 05:37:58 +02:00
2020-03-29 09:49:33 +02:00
<div class="setting full field-mapper-setting">
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n 'admin.wizard.action.add_fields'}}</label>
2020-03-29 09:49:33 +02:00
</div>
2020-03-24 10:35:46 +01:00
{{wizard-field-mapper
2020-03-21 18:30:11 +01:00
inputs=action.add_fields
wizardFields=wizardFields}}
2017-10-22 05:37:58 +02:00
</div>
2017-09-23 04:34:07 +02:00
{{/if}}
2017-10-06 04:59:02 +02:00
2017-10-05 02:36:46 +02:00
{{#if updateProfile}}
2020-03-29 09:49:33 +02:00
<div class="setting full field-mapper-setting">
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n 'admin.wizard.action.add_fields'}}</label>
2020-03-29 09:49:33 +02:00
</div>
2020-03-24 10:35:46 +01:00
{{wizard-field-mapper
2020-03-21 18:30:11 +01:00
inputs=action.profile_updates
wizardFields=wizardFields
options=(hash
2020-03-24 10:35:46 +01:00
wizardFieldSelection=true
userFieldSelection=true
2020-03-21 18:30:11 +01:00
)}}
2017-10-06 04:59:02 +02:00
</div>
2017-09-23 04:34:07 +02:00
{{/if}}
2019-06-03 09:09:24 +02:00
{{#if sendToApi}}
<div class="setting">
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n "admin.wizard.action.send_to_api.api"}}</label>
2019-06-03 09:09:24 +02:00
</div>
2020-03-29 09:49:33 +02:00
2019-06-03 09:09:24 +02:00
<div class="setting-value">
2020-02-02 11:42:05 +01:00
{{combo-box
value=action.api
content=availableApis
2020-03-29 09:49:33 +02:00
onChange=(action (mut action.api))
2020-03-22 07:47:56 +01:00
options=(hash
2020-03-29 09:49:33 +02:00
isDisabled=action.custom_title_enabled
2020-03-22 07:47:56 +01:00
none='admin.wizard.action.send_to_api.select_an_api'
)}}
2019-06-03 09:09:24 +02:00
</div>
</div>
<div class="setting">
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n "admin.wizard.action.send_to_api.endpoint"}}</label>
2019-06-03 09:09:24 +02:00
</div>
2020-03-29 09:49:33 +02:00
2019-06-03 09:09:24 +02:00
<div class="setting-value">
2020-02-02 11:42:05 +01:00
{{combo-box
value=action.api_endpoint
content=availableEndpoints
2020-03-29 09:49:33 +02:00
onChange=(action (mut action.api_endpoint))
2020-03-22 07:47:56 +01:00
options=(hash
2020-03-29 09:49:33 +02:00
isDisabled=apiEmpty
2020-03-22 07:47:56 +01:00
none='admin.wizard.action.send_to_api.select_an_endpoint'
)}}
2019-06-03 09:09:24 +02:00
</div>
</div>
2020-03-30 01:53:28 +02:00
<div class="setting full">
2019-06-03 09:09:24 +02:00
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n "admin.wizard.action.send_to_api.body"}}</label>
2019-06-03 09:09:24 +02:00
</div>
2020-03-29 09:49:33 +02:00
2019-06-03 09:09:24 +02:00
<div class="setting-value">
2020-03-29 09:49:33 +02:00
{{wizard-text-editor
2020-03-21 18:30:11 +01:00
value=action.api_body
2020-03-30 01:53:28 +02:00
previewEnabled=false
barEnabled=false
wizardFields=wizardFields
placeholder='admin.wizard.action.send_to_api.body_placeholder'}}
2019-06-03 09:09:24 +02:00
</div>
</div>
{{/if}}
2019-07-01 04:31:50 +02:00
{{#if addToGroup}}
2020-03-29 09:49:33 +02:00
<div class="setting full field-mapper-setting">
2019-07-01 04:31:50 +02:00
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n "admin.wizard.group"}}</label>
2019-07-01 04:31:50 +02:00
</div>
2020-03-29 09:49:33 +02:00
2019-07-01 04:31:50 +02:00
<div class="setting-value">
2020-03-24 10:35:46 +01:00
{{wizard-field-mapper
inputs=action.inputs
2020-03-23 06:41:04 +01:00
wizardFields=wizardFields
outputConnectorKey='admin.wizard.action.add_to_group.output_connector'
2020-03-21 18:30:11 +01:00
options=(hash
2020-03-23 06:41:04 +01:00
hasOutput=true
enableConnectors=true
2020-03-24 10:35:46 +01:00
wizardFieldSelection='key,value,assignment'
userFieldSelection='key,value,assignment'
groupSelection='value,output'
2020-03-21 18:30:11 +01:00
)}}
</div>
</div>
2019-07-01 04:31:50 +02:00
{{/if}}
{{#if routeTo}}
<div class="setting">
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n "admin.wizard.action.route_to.url"}}</label>
</div>
2020-03-29 09:49:33 +02:00
<div class="setting-value">
{{input value=action.url}}
</div>
</div>
2020-03-29 09:49:33 +02:00
<div class="setting">
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n "admin.wizard.action.route_to.code"}}</label>
</div>
2020-03-29 09:49:33 +02:00
<div class="setting-value">
{{input value=action.code}}
</div>
</div>
{{/if}}