2022-04-19 19:31:43 +08:00
|
|
|
<div class="user-field">
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#if (or this.isEditing (not this.userField.id))}}
|
2022-06-30 18:30:50 +08:00
|
|
|
<AdminFormRow @label="admin.user_fields.type">
|
2022-07-06 01:41:31 +08:00
|
|
|
<ComboBox @content={{this.fieldTypes}} @value={{this.buffered.field_type}} @onChange={{action (mut this.buffered.field_type)}} />
|
2022-06-30 18:30:50 +08:00
|
|
|
</AdminFormRow>
|
2015-07-28 02:22:12 +08:00
|
|
|
|
2022-06-30 18:30:50 +08:00
|
|
|
<AdminFormRow @label="admin.user_fields.name">
|
2022-07-06 16:37:54 +08:00
|
|
|
<Input @value={{this.buffered.name}} class="user-field-name" maxlength="255" />
|
2022-06-30 18:30:50 +08:00
|
|
|
</AdminFormRow>
|
2015-07-28 02:22:12 +08:00
|
|
|
|
2022-06-30 18:30:50 +08:00
|
|
|
<AdminFormRow @label="admin.user_fields.description">
|
2022-07-06 16:37:54 +08:00
|
|
|
<Input @value={{this.buffered.description}} class="user-field-desc" maxlength="255" />
|
2022-06-30 18:30:50 +08:00
|
|
|
</AdminFormRow>
|
2015-07-29 00:29:40 +08:00
|
|
|
|
2022-07-06 01:41:31 +08:00
|
|
|
{{#if this.bufferedFieldType.hasOptions}}
|
2022-06-30 18:30:50 +08:00
|
|
|
<AdminFormRow @label="admin.user_fields.options">
|
2022-07-06 01:41:31 +08:00
|
|
|
<ValueList @values={{this.buffered.options}} @inputType="array" />
|
2022-06-30 18:30:50 +08:00
|
|
|
</AdminFormRow>
|
2022-04-19 19:31:43 +08:00
|
|
|
{{/if}}
|
2015-07-28 02:22:12 +08:00
|
|
|
|
2022-06-30 18:30:50 +08:00
|
|
|
<AdminFormRow @wrapLabel="true">
|
2022-07-06 01:41:31 +08:00
|
|
|
<Input @type="checkbox" @checked={{this.buffered.editable}} /> <span>{{i18n "admin.user_fields.editable.title"}}</span>
|
2022-06-30 18:30:50 +08:00
|
|
|
</AdminFormRow>
|
2015-07-28 02:22:12 +08:00
|
|
|
|
2022-06-30 18:30:50 +08:00
|
|
|
<AdminFormRow @wrapLabel="true">
|
2022-07-06 01:41:31 +08:00
|
|
|
<Input @type="checkbox" @checked={{this.buffered.required}} /> <span>{{i18n "admin.user_fields.required.title"}}</span>
|
2022-06-30 18:30:50 +08:00
|
|
|
</AdminFormRow>
|
2015-07-28 02:22:12 +08:00
|
|
|
|
2022-06-30 18:30:50 +08:00
|
|
|
<AdminFormRow @wrapLabel="true">
|
2022-07-06 01:41:31 +08:00
|
|
|
<Input @type="checkbox" @checked={{this.buffered.show_on_profile}} /> <span>{{i18n "admin.user_fields.show_on_profile.title"}}</span>
|
2022-06-30 18:30:50 +08:00
|
|
|
</AdminFormRow>
|
2021-04-27 13:52:45 +08:00
|
|
|
|
2022-06-30 18:30:50 +08:00
|
|
|
<AdminFormRow @wrapLabel="true">
|
2022-07-06 01:41:31 +08:00
|
|
|
<Input @type="checkbox" @checked={{this.buffered.show_on_user_card}} /> <span>{{i18n "admin.user_fields.show_on_user_card.title"}}</span>
|
2022-06-30 18:30:50 +08:00
|
|
|
</AdminFormRow>
|
2016-04-08 20:35:41 +08:00
|
|
|
|
2022-06-30 18:30:50 +08:00
|
|
|
<AdminFormRow @wrapLabel="true">
|
2022-07-06 01:41:31 +08:00
|
|
|
<Input @type="checkbox" @checked={{this.buffered.searchable}} /> <span>{{i18n "admin.user_fields.searchable.title"}}</span>
|
2022-06-30 18:30:50 +08:00
|
|
|
</AdminFormRow>
|
2022-04-19 19:31:43 +08:00
|
|
|
|
2022-06-30 18:30:50 +08:00
|
|
|
<AdminFormRow>
|
|
|
|
<DButton @action={{action "save"}} @class="btn-primary save" @icon="check" @label="admin.user_fields.save" />
|
|
|
|
<DButton @action={{action "cancel"}} @class="btn-danger cancel" @icon="times" @label="admin.user_fields.cancel" />
|
|
|
|
</AdminFormRow>
|
2022-04-19 19:31:43 +08:00
|
|
|
{{else}}
|
|
|
|
<div class="row">
|
|
|
|
<div class="form-display">
|
2022-07-06 01:41:31 +08:00
|
|
|
<b class="name">{{this.userField.name}}</b>
|
2022-04-19 19:31:43 +08:00
|
|
|
<br>
|
2022-07-06 01:41:31 +08:00
|
|
|
<span class="description">{{html-safe this.userField.description}}</span>
|
2022-04-19 19:31:43 +08:00
|
|
|
</div>
|
2022-07-06 01:41:31 +08:00
|
|
|
<div class="form-display field-type">{{this.fieldName}}</div>
|
2022-04-19 19:31:43 +08:00
|
|
|
<div class="form-element controls">
|
2022-06-30 18:30:50 +08:00
|
|
|
<DButton @action={{action "edit"}} @class="btn-default edit" @icon="pencil-alt" @label="admin.user_fields.edit" />
|
2022-07-06 01:41:31 +08:00
|
|
|
<DButton @action={{this.destroyAction}} @actionParam={{this.userField}} @class="btn-danger cancel" @icon="far-trash-alt" @label="admin.user_fields.delete" />
|
|
|
|
<DButton @action={{this.moveUpAction}} @actionParam={{this.userField}} @class="btn-default" @icon="arrow-up" @disabled={{this.cantMoveUp}} />
|
|
|
|
<DButton @action={{this.moveDownAction}} @actionParam={{this.userField}} @class="btn-default" @icon="arrow-down" @disabled={{this.cantMoveDown}} />
|
2022-04-19 19:31:43 +08:00
|
|
|
</div>
|
2015-07-11 00:28:56 +08:00
|
|
|
</div>
|
2022-07-06 01:41:31 +08:00
|
|
|
<div class="row">{{this.flags}}</div>
|
2022-04-19 19:31:43 +08:00
|
|
|
{{/if}}
|
|
|
|
</div>
|