0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-25 18:50:27 +01:00
discourse-custom-wizard/assets/javascripts/discourse/templates/components/custom-field-input.hbs
Angus McLeod 61ad74e07b Revert "Update action usage"
This reverts commit 37685ea8cf.
2022-04-04 12:14:00 +02:00

83 Zeilen
2 KiB
Handlebars

{{#if showInputs}}
<td>
{{wizard-subscription-selector
value=field.klass
feature="custom_field"
attribute="klass"
onChange=(action (mut field.klass))
options=(hash
none="admin.wizard.custom_field.klass.select"
)}}
</td>
<td>
{{wizard-subscription-selector
value=field.type
feature="custom_field"
attribute="type"
onChange=(action (mut field.type))
options=(hash
none="admin.wizard.custom_field.type.select"
)}}
</td>
<td class="input">
{{input
value=field.name
placeholder=(i18n "admin.wizard.custom_field.name.select")}}
</td>
<td class="multi-select">
{{multi-select
value=field.serializers
content=serializerContent
onChange=(action (mut field.serializers))
options=(hash
none="admin.wizard.custom_field.serializers.select"
)}}
</td>
<td class="actions">
{{#if loading}}
{{loading-spinner size="small"}}
{{else}}
{{#if saveIcon}}
{{d-icon saveIcon}}
{{/if}}
{{/if}}
{{d-button
action=(action "destroy")
icon="trash-alt"
class="destroy"
disabled=destroyDisabled}}
{{d-button
icon="save"
action=(action "save")
disabled=saveDisabled
class="save"}}
{{d-button
action=(action "close")
icon="times"
disabled=closeDisabled}}
</td>
{{else}}
<td><label>{{field.klass}}</label></td>
<td><label>{{field.type}}</label></td>
<td class="input"><label>{{field.name}}</label></td>
<td class="multi-select">
{{#if isExternal}}
&mdash;
{{else}}
{{#each field.serializers as |serializer|}}
<label>{{serializer}}</label>
{{/each}}
{{/if}}
</td>
{{#if isExternal}}
<td class="external">
<label title={{i18n "admin.wizard.custom_field.external.title"}}>
{{i18n "admin.wizard.custom_field.external.label"}}
</label>
</td>
{{else}}
<td class="actions">
{{d-button action=(action "edit") icon="pencil-alt"}}
</td>
{{/if}}
{{/if}}