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
|
|
|
|
2023-10-31 15:57:50 +08:00
|
|
|
<AdminFormRow @wrapLabel="true" @type="checkbox">
|
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
|
|
|
|
2023-10-31 15:57:50 +08:00
|
|
|
<AdminFormRow @wrapLabel="true" @type="checkbox">
|
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
|
|
|
|
2023-10-31 15:57:50 +08:00
|
|
|
<AdminFormRow @wrapLabel="true" @type="checkbox">
|
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
|
|
|
|
2023-10-31 15:57:50 +08:00
|
|
|
<AdminFormRow @wrapLabel="true" @type="checkbox">
|
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
|
|
|
|
2023-10-31 15:57:50 +08:00
|
|
|
<AdminFormRow @wrapLabel="true" @type="checkbox">
|
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
|
|
|
|
2023-12-28 23:24:24 +08:00
|
|
|
<PluginOutlet
|
|
|
|
@name="after-admin-user-fields"
|
|
|
|
@outletArgs={{hash buffered=this.buffered}}
|
|
|
|
/>
|
|
|
|
|
2022-06-30 18:30:50 +08:00
|
|
|
<AdminFormRow>
|
|
|
|
<DButton
|
2023-08-31 17:49:35 +08:00
|
|
|
@action={{this.save}}
|
2022-06-30 18:30:50 +08:00
|
|
|
@icon="check"
|
|
|
|
@label="admin.user_fields.save"
|
2023-08-31 17:49:35 +08:00
|
|
|
class="btn-primary save"
|
2022-06-30 18:30:50 +08:00
|
|
|
/>
|
|
|
|
<DButton
|
2023-08-31 17:49:35 +08:00
|
|
|
@action={{this.cancel}}
|
2022-06-30 18:30:50 +08:00
|
|
|
@icon="times"
|
|
|
|
@label="admin.user_fields.cancel"
|
2023-08-31 17:49:35 +08:00
|
|
|
class="btn-danger cancel"
|
2022-06-30 18:30:50 +08:00
|
|
|
/>
|
|
|
|
</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
|
2023-08-31 17:49:35 +08:00
|
|
|
@action={{this.edit}}
|
2022-06-30 18:30:50 +08:00
|
|
|
@icon="pencil-alt"
|
|
|
|
@label="admin.user_fields.edit"
|
2023-08-31 17:49:35 +08:00
|
|
|
class="btn-default edit"
|
2022-06-30 18:30:50 +08:00
|
|
|
/>
|
2022-07-06 01:41:31 +08:00
|
|
|
<DButton
|
2023-08-31 17:49:35 +08:00
|
|
|
@action={{fn this.destroyAction this.userField}}
|
2022-07-06 01:41:31 +08:00
|
|
|
@icon="far-trash-alt"
|
|
|
|
@label="admin.user_fields.delete"
|
2023-08-31 17:49:35 +08:00
|
|
|
class="btn-danger cancel"
|
2022-07-06 01:41:31 +08:00
|
|
|
/>
|
|
|
|
<DButton
|
2023-08-31 17:49:35 +08:00
|
|
|
@action={{fn this.moveUpAction this.userField}}
|
2022-07-06 01:41:31 +08:00
|
|
|
@icon="arrow-up"
|
|
|
|
@disabled={{this.cantMoveUp}}
|
2023-08-31 17:49:35 +08:00
|
|
|
class="btn-default"
|
2022-07-06 01:41:31 +08:00
|
|
|
/>
|
|
|
|
<DButton
|
2023-08-31 17:49:35 +08:00
|
|
|
@action={{fn this.moveDownAction this.userField}}
|
2022-07-06 01:41:31 +08:00
|
|
|
@icon="arrow-down"
|
|
|
|
@disabled={{this.cantMoveDown}}
|
2023-08-31 17:49:35 +08:00
|
|
|
class="btn-default"
|
2022-07-06 01:41:31 +08:00
|
|
|
/>
|
2022-04-19 19:31:43 +08:00
|
|
|
</div>
|
2015-07-11 00:28:56 +08:00
|
|
|
</div>
|
2023-08-16 04:59:04 +08:00
|
|
|
<div class="row user-field-flags">{{this.flags}}</div>
|
2022-04-19 19:31:43 +08:00
|
|
|
{{/if}}
|
|
|
|
</div>
|