0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-30 12:31:10 +01:00
discourse-custom-wizard/assets/javascripts/discourse/templates/components/wizard-custom-action.hbs
2020-03-24 21:22:32 +11:00

320 Zeilen
9,1 KiB
Handlebars

<div class="setting">
<div class="setting-label">
<h3>{{i18n "admin.wizard.id"}}</h3>
</div>
<div class="setting-value">
{{input value=action.id placeholderKey='admin.wizard.id_placeholder' disabled=disableId}}
</div>
</div>
<div class="setting">
<div class="setting-label">
<h3>{{i18n "admin.wizard.type"}}</h3>
</div>
<div class="setting-value">
{{combo-box
value=action.type
content=types
options=(hash
none="admin.wizard.field.type"
)}}
</div>
</div>
{{#if basicTopicFields}}
<div class="setting">
<div class="setting-label">
<h3>{{i18n "admin.wizard.action.title"}}</h3>
</div>
<div class="setting-value">
{{combo-box
value=action.title
content=wizardFields
nameProperty="label"
isDisabled=action.custom_title_enabled
options=(hash
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>
</div>
</div>
<div class="setting">
<div class="setting-label">
<h3>{{i18n "admin.wizard.action.post"}}</h3>
</div>
<div class="setting-value">
{{combo-box
value=action.post
content=wizardFields
nameProperty='label'
isDisabled=action.post_builder
options=(hash
none='admin.wizard.select_field'
)}}
<div class="setting-gutter">
{{input type='checkbox' checked=action.post_builder}}
<span>{{i18n 'admin.wizard.action.post_builder.checkbox'}}</span>
</div>
</div>
</div>
{{#if action.post_builder}}
<div class="setting full">
<div class="setting-label">
<h3>{{i18n 'admin.wizard.action.post_builder.label'}}</h3>
</div>
<div class="setting-value editor">
{{d-editor
value=action.post_template
placeholder='admin.wizard.action.interpolate_fields'
classNames='post-builder-editor'}}
<div>
<label>{{i18n 'admin.wizard.action.post_builder.user_fields'}}{{builderUserFields}}</label>
<label>{{i18n 'admin.wizard.action.post_builder.wizard_fields'}}{{builderWizardFields}}</label>
</div>
</div>
</div>
{{/if}}
{{/if}}
{{#if publicTopicFields}}
<div class="setting">
<div class="setting-label">
<h3>{{i18n "admin.wizard.action.create_topic.category"}}</h3>
</div>
<div class="setting-value">
{{category-chooser
value=action.category_id
isDisabled=action.custom_category_enabled}}
<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.wizard_field'}}</span>
{{#if action.custom_category_wizard_field}}
{{combo-box
value=action.category_id
content=categoryFields
nameProperty="label"
options=(hash
none='admin.wizard.select_field'
)}}
{{/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>
</div>
</div>
<div class="setting">
<div class="setting-label">
<h3>{{i18n "admin.wizard.action.create_topic.tags"}}</h3>
</div>
<div class="setting-value">
{{tag-chooser
tags=action.tags
filterable=true
allowCreate=true
isDisabled=action.custom_tag_enabled}}
<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">
{{combo-box
value=action.custom_tag_field
content=tagFields
nameProperty="label"
options=(hash
none='admin.wizard.select_field'
)}}
</div>
{{/if}}
</div>
</div>
</div>
{{/if}}
{{#if newTopicFields}}
<div class="setting">
<div class="setting-label">
<h3>{{i18n "admin.wizard.action.skip_redirect.label"}}</h3>
</div>
<div class="setting-value">
{{input type='checkbox' checked=action.skip_redirect}}
<span>{{i18n 'admin.wizard.action.skip_redirect.description' type='topic'}}</span>
</div>
</div>
{{/if}}
{{#if createTopic}}
<div class="setting full">
<label>{{i18n 'admin.wizard.action.add_fields' type='Topic'}}</label>
{{wizard-field-mapper
inputs=action.add_fields
userFields=userFields
wizardFields=wizardFields
options=(hash
wizardFieldSelection=true
)}}
</div>
{{/if}}
{{#if sendMessage}}
<div class="setting">
<div class="setting-label">
<h3>{{i18n 'admin.wizard.required'}}</h3>
</div>
<div class="setting-value">
{{combo-box
value=action.required
content=wizardFields
nameProperty='label'
options=(hash
none='admin.wizard.select_field'
)}}
</div>
</div>
<div class="setting">
<div class="setting-label">
<h3>{{i18n "admin.wizard.action.send_message.recipient"}}</h3>
</div>
<div class="setting-value">
{{user-selector
single="true"
includeMentionableGroups="true"
usernames=action.username
allowedUsers="true"}}
</div>
</div>
<div class="setting full">
<label>{{i18n "admin.wizard.action.add_fields" type='Message'}}</label>
{{wizard-field-mapper
inputs=action.add_fields
userFields=userFields
wizardFields=wizardFields}}
</div>
{{/if}}
{{#if updateProfile}}
<div class="setting full">
<label>{{i18n "admin.wizard.action.add_fields" type='Profile'}}</label>
{{wizard-field-mapper
inputs=action.profile_updates
userFields=userFields
wizardFields=wizardFields
options=(hash
wizardFieldSelection=true
userFieldSelection=true
)}}
</div>
{{/if}}
{{#if sendToApi}}
<div class="setting">
<div class="setting-label">
<h3>{{i18n "admin.wizard.action.send_to_api.api"}}</h3>
</div>
<div class="setting-value">
{{combo-box
value=action.api
content=availableApis
isDisabled=action.custom_title_enabled
options=(hash
none='admin.wizard.action.send_to_api.select_an_api'
)}}
</div>
</div>
<div class="setting">
<div class="setting-label">
<h3>{{i18n "admin.wizard.action.send_to_api.endpoint"}}</h3>
</div>
<div class="setting-value">
{{combo-box
value=action.api_endpoint
content=availableEndpoints
isDisabled=apiEmpty
options=(hash
none='admin.wizard.action.send_to_api.select_an_endpoint'
)}}
</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>
{{textarea
value=action.api_body
placeholder=(i18n 'admin.wizard.action.interpolate_fields')}}
</div>
</div>
{{/if}}
{{#if addToGroup}}
<div class="setting full">
<div class="setting-label">
<h3>{{i18n "admin.wizard.action.add_to_group.group"}}</h3>
</div>
<div class="setting-value">
{{wizard-field-mapper
inputs=action.inputs
userFields=userFields
wizardFields=wizardFields
outputConnectorKey='admin.wizard.action.add_to_group.output_connector'
options=(hash
hasOutput=true
enableConnectors=true
wizardFieldSelection='key,value,assignment'
userFieldSelection='key,value,assignment'
groupSelection='value,output'
)}}
</div>
</div>
{{/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}}