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}}
|
2024-03-07 01:05:03 +08:00
|
|
|
@onChange={{fn (mut this.buffered.field_type)}}
|
2022-07-06 01:41:31 +08:00
|
|
|
/>
|
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"
|
2024-05-04 00:09:55 +08:00
|
|
|
maxlength="1000"
|
2022-07-06 16:37:54 +08:00
|
|
|
/>
|
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
|
|
|
|
2024-05-23 19:18:25 +08:00
|
|
|
<AdminFormRow @label="admin.user_fields.requirement.title">
|
|
|
|
<label class="optional">
|
|
|
|
<RadioButton
|
|
|
|
@value="optional"
|
2024-06-25 19:32:18 +08:00
|
|
|
@name="requirement"
|
2024-05-23 19:18:25 +08:00
|
|
|
@selection={{this.buffered.requirement}}
|
2024-06-25 19:32:18 +08:00
|
|
|
@onChange={{action "changeRequirementType"}}
|
2024-05-23 19:18:25 +08:00
|
|
|
/>
|
|
|
|
<span>{{i18n "admin.user_fields.requirement.optional.title"}}</span>
|
|
|
|
</label>
|
2015-07-28 02:22:12 +08:00
|
|
|
|
2024-06-25 19:32:18 +08:00
|
|
|
<label class="for_all_users">
|
|
|
|
<RadioButton
|
|
|
|
@value="for_all_users"
|
|
|
|
@name="requirement"
|
|
|
|
@selection={{this.buffered.requirement}}
|
|
|
|
@onChange={{action "changeRequirementType"}}
|
|
|
|
/>
|
|
|
|
<div class="label-text">
|
|
|
|
<span>{{i18n
|
|
|
|
"admin.user_fields.requirement.for_all_users.title"
|
|
|
|
}}</span>
|
|
|
|
<div class="description">{{i18n
|
|
|
|
"admin.user_fields.requirement.for_all_users.description"
|
|
|
|
}}</div>
|
|
|
|
</div>
|
|
|
|
</label>
|
|
|
|
|
2024-05-23 19:18:25 +08:00
|
|
|
<label class="on_signup">
|
|
|
|
<RadioButton
|
|
|
|
@value="on_signup"
|
2024-06-25 19:32:18 +08:00
|
|
|
@name="requirement"
|
2024-05-23 19:18:25 +08:00
|
|
|
@selection={{this.buffered.requirement}}
|
2024-06-25 19:32:18 +08:00
|
|
|
@onChange={{action "changeRequirementType"}}
|
2024-05-23 19:18:25 +08:00
|
|
|
/>
|
|
|
|
<div class="label-text">
|
|
|
|
<span>{{i18n "admin.user_fields.requirement.on_signup.title"}}</span>
|
|
|
|
<div class="description">{{i18n
|
|
|
|
"admin.user_fields.requirement.on_signup.description"
|
|
|
|
}}</div>
|
|
|
|
</div>
|
|
|
|
</label>
|
2022-06-30 18:30:50 +08:00
|
|
|
</AdminFormRow>
|
2015-07-28 02:22:12 +08:00
|
|
|
|
2024-05-23 19:18:25 +08:00
|
|
|
<AdminFormRow @label="admin.user_fields.preferences">
|
|
|
|
<label>
|
2024-06-25 19:32:18 +08:00
|
|
|
<Input
|
|
|
|
@type="checkbox"
|
|
|
|
@checked={{this.buffered.editable}}
|
|
|
|
disabled={{this.editableDisabled}}
|
|
|
|
/>
|
2024-05-23 19:18:25 +08:00
|
|
|
<span>{{i18n "admin.user_fields.editable.title"}}</span>
|
|
|
|
</label>
|
2021-04-27 13:52:45 +08:00
|
|
|
|
2024-05-23 19:18:25 +08:00
|
|
|
<label>
|
|
|
|
<Input @type="checkbox" @checked={{this.buffered.show_on_profile}} />
|
|
|
|
<span>{{i18n "admin.user_fields.show_on_profile.title"}}</span>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label>
|
|
|
|
<Input @type="checkbox" @checked={{this.buffered.show_on_user_card}} />
|
|
|
|
<span>{{i18n "admin.user_fields.show_on_user_card.title"}}</span>
|
|
|
|
</label>
|
2016-04-08 20:35:41 +08:00
|
|
|
|
2024-05-23 19:18:25 +08:00
|
|
|
<label>
|
|
|
|
<Input @type="checkbox" @checked={{this.buffered.searchable}} />
|
|
|
|
<span>{{i18n "admin.user_fields.searchable.title"}}</span>
|
|
|
|
</label>
|
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}}
|
2024-09-13 23:50:52 +08:00
|
|
|
@icon="xmark"
|
2022-06-30 18:30:50 +08:00
|
|
|
@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}}
|
2024-09-13 23:50:52 +08:00
|
|
|
@icon="pencil"
|
2022-06-30 18:30:50 +08:00
|
|
|
@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}}
|
2024-09-13 23:50:52 +08:00
|
|
|
@icon="trash-can"
|
2022-07-06 01:41:31 +08:00
|
|
|
@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>
|