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

322 Zeilen
9,2 KiB
Handlebars

2017-10-06 04:59:02 +02:00
<div class="setting">
<div class="setting-label">
2017-10-17 09:18:53 +02:00
<h3>{{i18n "admin.wizard.id"}}</h3>
2017-10-06 04:59:02 +02:00
</div>
<div class="setting-value">
2017-10-17 15:17:53 +02:00
{{input value=action.id placeholderKey='admin.wizard.id_placeholder' disabled=disableId}}
2017-10-06 04:59:02 +02:00
</div>
</div>
<div class="setting">
<div class="setting-label">
2017-10-13 15:02:34 +02:00
<h3>{{i18n "admin.wizard.type"}}</h3>
2017-10-06 04:59:02 +02:00
</div>
<div class="setting-value">
2020-02-02 11:42:05 +01:00
{{combo-box
value=action.type
content=types
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">
2017-10-17 09:18:53 +02:00
<h3>{{i18n "admin.wizard.action.title"}}</h3>
2017-10-06 04:59:02 +02:00
</div>
<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"
isDisabled=action.custom_title_enabled
none='admin.wizard.select_field'}}
<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">
2017-10-17 09:18:53 +02:00
<h3>{{i18n "admin.wizard.action.post"}}</h3>
2017-10-06 04:59:02 +02:00
</div>
<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'
isDisabled=action.post_builder
none='admin.wizard.select_field'}}
<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">
<h3>{{i18n 'admin.wizard.action.post_builder.label'}}</h3>
</div>
2019-08-27 08:05:24 +02:00
<div class="setting-value editor">
2020-03-21 18:30:11 +01:00
{{d-editor
value=action.post_template
placeholder='admin.wizard.action.interpolate_fields'
classNames='post-builder-editor'}}
2019-08-27 08:05:24 +02:00
<div>
<label>{{i18n 'admin.wizard.action.post_builder.user_fields'}}{{builderUserFields}}</label>
<label>{{i18n 'admin.wizard.action.post_builder.wizard_fields'}}{{builderWizardFields}}</label>
</div>
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">
2019-08-27 08:05:24 +02:00
<h3>{{i18n "admin.wizard.action.create_topic.category"}}</h3>
2018-09-18 03:56:42 +02:00
</div>
<div class="setting-value">
2020-02-02 11:42:05 +01:00
{{category-chooser
value=action.category_id
isDisabled=action.custom_category_enabled}}
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>
{{#if action.custom_category_enabled}}
<div class="custom-category">
<div>
{{input type='checkbox' checked=action.custom_category_wizard_field}}
<span>{{i18n 'admin.wizard.action.custom_category.wizard_field'}}</span>
{{#if action.custom_category_wizard_field}}
2020-02-02 11:42:05 +01:00
{{combo-box
value=action.category_id
content=categoryFields
nameProperty="label"
none='admin.wizard.select_field'}}
2019-08-27 08:05:24 +02:00
{{/if}}
</div>
<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">
2019-08-27 08:05:24 +02:00
<h3>{{i18n "admin.wizard.action.create_topic.tags"}}</h3>
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>
{{#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"
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">
2019-08-27 08:05:24 +02:00
<h3>{{i18n "admin.wizard.action.skip_redirect.label"}}</h3>
2017-10-06 04:59:02 +02:00
</div>
<div class="setting-value">
2019-08-27 08:05:24 +02:00
{{input type='checkbox' checked=action.skip_redirect}}
<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}}
<div class="setting full">
<label>{{i18n 'admin.wizard.action.add_fields' type='Topic'}}</label>
2020-03-21 18:30:11 +01:00
{{wizard-custom-inputs
inputs=action.add_fields
userFields=userFields
wizardFields=wizardFields
options=(hash
allowWizardField=true
)}}
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">
<h3>{{i18n 'admin.wizard.required'}}</h3>
</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'
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">
<h3>{{i18n "admin.wizard.action.send_message.recipient"}}</h3>
</div>
<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
<div class="setting full">
<label>{{i18n "admin.wizard.action.add_fields" type='Message'}}</label>
2020-03-21 18:30:11 +01:00
{{wizard-custom-inputs
inputs=action.add_fields
userFields=userFields
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}}
2017-10-17 09:18:53 +02:00
<div class="setting full">
2017-10-22 05:37:58 +02:00
<label>{{i18n "admin.wizard.action.add_fields" type='Profile'}}</label>
2020-03-21 18:30:11 +01:00
{{wizard-custom-inputs
inputs=action.profile_updates
userFields=userFields
wizardFields=wizardFields
options=(hash
allowWizardField=true
allowUserField=true
)}}
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">
<h3>{{i18n "admin.wizard.action.send_to_api.api"}}</h3>
</div>
<div class="setting-value">
2020-02-02 11:42:05 +01:00
{{combo-box
value=action.api
content=availableApis
isDisabled=action.custom_title_enabled
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">
<h3>{{i18n "admin.wizard.action.send_to_api.endpoint"}}</h3>
</div>
<div class="setting-value">
2020-02-02 11:42:05 +01:00
{{combo-box
value=action.api_endpoint
content=availableEndpoints
isDisabled=apiEmpty
none='admin.wizard.action.send_to_api.select_an_endpoint'}}
2019-06-03 09:09:24 +02:00
</div>
</div>
<div class="setting api-body">
<div class="setting-label">
<h3>{{i18n "admin.wizard.action.send_to_api.body"}}</h3>
</div>
<div class="setting-value">
<label>{{i18n 'admin.wizard.action.post_builder.user_fields'}}{{builderUserFields}}</label>
<label>{{i18n 'admin.wizard.action.post_builder.wizard_fields'}}{{builderWizardFields}}</label>
2020-03-21 18:30:11 +01:00
{{textarea
value=action.api_body
placeholder=(i18n 'admin.wizard.action.interpolate_fields')}}
2019-06-03 09:09:24 +02:00
</div>
</div>
{{/if}}
2019-07-01 04:31:50 +02:00
{{#if addToGroup}}
<div class="setting">
<div class="setting-label">
<h3>{{i18n "admin.wizard.action.add_to_group.group_selection"}}</h3>
</div>
<div class="setting-value">
2020-02-02 11:42:05 +01:00
{{combo-box
2020-03-21 18:30:11 +01:00
value=action.value
content=wizardFields
isDisabled=action.custom
2020-02-02 11:42:05 +01:00
nameProperty="label"
none='admin.wizard.select_field'}}
2020-03-21 18:30:11 +01:00
2019-07-01 04:31:50 +02:00
<div class="setting-gutter">
{{input type='checkbox' checked=action.custom_group_enabled}}
<span>{{i18n 'admin.wizard.action.add_to_group.custom_group'}}</span>
2020-03-21 18:30:11 +01:00
2019-07-01 04:31:50 +02:00
{{#if action.custom_group_enabled}}
2020-03-21 18:30:11 +01:00
{{input value=action.custom}}
2019-07-01 04:31:50 +02:00
{{/if}}
</div>
</div>
</div>
2020-03-21 18:30:11 +01:00
<div class="setting">
<div class="setting-label">
<h3>{{i18n "admin.wizard.action.add_to_group.property"}}</h3>
</div>
<div class="setting-value">
{{combo-box
value=action.property
content=groupPropertyTypes
options=(hash
none='admin.wizard.select_property'
)}}
</div>
</div>
2019-07-01 04:31:50 +02:00
{{/if}}
{{#if routeTo}}
<div class="setting">
<div class="setting-label">
<h3>{{i18n "admin.wizard.action.route_to.url"}}</h3>
</div>
<div class="setting-value">
{{input value=action.url}}
</div>
</div>
<div class="setting">
<div class="setting-label">
<h3>{{i18n "admin.wizard.action.route_to.code"}}</h3>
</div>
<div class="setting-value">
{{input value=action.code}}
</div>
</div>
{{/if}}