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

187 Zeilen
4,6 KiB
Handlebars

2017-10-07 04:27:38 +02:00
<div class="setting">
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n 'admin.wizard.field.label'}}</label>
2017-10-07 04:27:38 +02:00
</div>
<div class="setting-value">
2020-03-30 01:53:28 +02:00
{{input name="label" value=field.label}}
2017-10-13 15:02:34 +02:00
</div>
</div>
<div class="setting">
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n 'admin.wizard.translation'}}</label>
2017-10-13 15:02:34 +02:00
</div>
<div class="setting-value">
2020-03-30 01:53:28 +02:00
{{input name="key" value=field.key placeholderKey="admin.wizard.translation_placeholder"}}
2017-10-07 04:27:38 +02:00
</div>
</div>
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.field.image'}}</label>
2017-09-23 04:34:07 +02:00
</div>
2017-10-06 04:59:02 +02:00
<div class="setting-value">
2020-03-30 01:53:28 +02:00
{{image-uploader
imageUrl=field.image
onUploadDone=(action "imageUploadDone")
onUploadDeleted=(action "imageUploadDeleted")
type="wizard-step"
class="no-repeat contain-image"}}
2017-09-23 04:34:07 +02:00
</div>
2017-10-06 04:59:02 +02:00
</div>
<div class="setting">
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n 'admin.wizard.field.description'}}</label>
2017-10-06 04:59:02 +02:00
</div>
<div class="setting-value">
2020-03-29 09:49:33 +02:00
{{textarea name="description" value=field.description}}
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.type'}}</label>
2017-10-06 04:59:02 +02:00
</div>
2020-03-30 01:53:28 +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=field.type
content=types
2020-03-29 09:49:33 +02:00
onChange=(action (mut field.type))
2020-03-22 07:47:56 +01:00
options=(hash
none="admin.wizard.field.type"
)}}
2017-09-23 04:34:07 +02:00
</div>
2017-10-06 04:59:02 +02:00
</div>
<div class="setting">
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n 'admin.wizard.field.required'}}</label>
2017-10-06 04:59:02 +02:00
</div>
2020-03-30 01:53:28 +02:00
2017-10-06 04:59:02 +02:00
<div class="setting-value">
<span>{{i18n 'admin.wizard.field.required_label'}}</span>
2020-03-30 01:53:28 +02:00
{{input type='checkbox' checked=field.required}}
2017-09-23 04:34:07 +02:00
</div>
</div>
2017-10-06 04:59:02 +02:00
2017-10-13 15:02:34 +02:00
{{#if isInput}}
<div class="setting">
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n 'admin.wizard.field.min_length'}}</label>
2017-10-13 15:02:34 +02:00
</div>
2020-03-30 01:53:28 +02:00
2017-10-13 15:02:34 +02:00
<div class="setting-value">
2020-03-30 01:53:28 +02:00
{{input type="number" name="min_length" value=field.min_length}}
2017-10-13 15:02:34 +02:00
</div>
</div>
{{/if}}
2017-10-06 04:59:02 +02:00
{{#if isDropdown}}
<div class="wizard-dropdown-choices">
2017-10-30 07:24:51 +01:00
<div class="wizard-header small underline">
2017-10-06 04:59:02 +02:00
{{i18n 'admin.wizard.field.choices_label'}}
</div>
2017-10-30 07:24:51 +01:00
2020-02-02 11:42:05 +01:00
{{combo-box
value=field.choices_type
content=choicesTypes
2020-03-29 09:49:33 +02:00
onChange=(action (mut field.choices_type))
2020-03-22 07:47:56 +01:00
options=(hash
none="admin.wizard.field.choices_type"
)}}
2017-10-30 07:24:51 +01:00
{{#if choicesTranslation}}
2017-10-13 15:02:34 +02:00
<div class="wizard-header small">
{{i18n 'admin.wizard.field.choices_translation'}}
</div>
2020-03-30 01:53:28 +02:00
{{input name="key" value=field.choices_key placeholderKey="admin.wizard.translation_placeholder"}}
2017-10-30 07:24:51 +01:00
{{/if}}
{{#if choicesCustom}}
2017-10-13 15:02:34 +02:00
<div class="wizard-header small">
{{i18n 'admin.wizard.field.choices_custom'}}
</div>
2020-03-24 10:35:46 +01:00
{{wizard-field-mapper
2020-03-21 18:30:11 +01:00
inputs=field.choices
wizardFields=wizardFields}}
2017-10-30 07:24:51 +01:00
{{/if}}
2017-11-09 03:50:48 +01:00
<div class="wizard-header small">
{{i18n 'admin.wizard.field.dropdown_none'}}
</div>
{{input name="dropdown_none" value=field.dropdown_none placeholder=(i18n 'admin.wizard.field.dropdown_none_placeholder')}}
2017-10-06 04:59:02 +02:00
</div>
{{/if}}
2019-07-19 05:47:17 +02:00
{{#if isUpload}}
<div class="setting">
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n 'admin.wizard.field.file_types'}}</label>
2019-07-19 05:47:17 +02:00
</div>
2020-03-30 01:53:28 +02:00
2019-07-19 05:47:17 +02:00
<div class="setting-value">
{{input value=field.file_types}}
</div>
</div>
{{/if}}
{{#if isCategory}}
<div class="setting">
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n 'admin.wizard.field.property'}}</label>
</div>
2020-03-30 01:53:28 +02:00
<div class="setting-value">
2020-02-02 11:42:05 +01:00
{{combo-box
2020-03-21 18:30:11 +01:00
value=field.property
2020-03-29 09:49:33 +02:00
content=categoryPropertyTypes
onChange=(action (mut field.property))
2020-03-21 18:30:11 +01:00
options=(hash
none='admin.wizard.select_property'
)}}
</div>
</div>
{{/if}}
2020-03-21 18:30:11 +01:00
2020-03-30 01:53:28 +02:00
{{#if isCategoryOrTag}}
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.field.limit'}}</label>
</div>
<div class="setting-value">
{{input type="number" value=field.limit}}
</div>
</div>
{{/if}}
2020-03-29 09:49:33 +02:00
<div class="setting full field-mapper-setting">
2020-03-21 18:30:11 +01:00
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n 'admin.wizard.field.prefill'}}</label>
2020-03-21 18:30:11 +01:00
</div>
2020-03-30 01:53:28 +02:00
2020-03-21 18:30:11 +01:00
<div class="setting-value">
2020-03-24 10:35:46 +01:00
{{wizard-field-mapper
2020-03-21 18:30:11 +01:00
inputs=field.prefill
wizardFields=wizardFields
2020-03-23 06:41:04 +01:00
options=prefillOptions}}
2020-03-21 18:30:11 +01:00
</div>
</div>
2020-03-24 10:35:46 +01:00
{{#if canFilter}}
2020-03-29 09:49:33 +02:00
<div class="setting full field-mapper-setting">
2020-03-24 10:35:46 +01:00
<div class="setting-label">
2020-03-30 01:53:28 +02:00
<label>{{i18n 'admin.wizard.field.filter'}}</label>
2020-03-24 10:35:46 +01:00
</div>
2020-03-30 01:53:28 +02:00
2020-03-24 10:35:46 +01:00
<div class="setting-value">
{{wizard-field-mapper
inputs=field.filters
wizardFields=wizardFields
options=filterOptions}}
</div>
</div>
{{/if}}