mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 01:21:35 +08:00
FEATURE: add multiselect user custom field (#13560)
New user custom field similar to dropdown but allowing users to select multiple options.
This commit is contained in:
parent
a6363170e9
commit
a69839689d
|
@ -15,6 +15,7 @@ UserField.reopenClass({
|
|||
UserFieldType.create({ id: "text" }),
|
||||
UserFieldType.create({ id: "confirm" }),
|
||||
UserFieldType.create({ id: "dropdown", hasOptions: true }),
|
||||
UserFieldType.create({ id: "multiselect", hasOptions: true }),
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
<label class="control-label" for={{concat "user-" this.elementId}}>
|
||||
{{html-safe this.field.name}}
|
||||
{{#if this.field.required}}
|
||||
<span class="required">*</span>
|
||||
{{/if}}
|
||||
</label>
|
||||
|
||||
<div class="controls">
|
||||
{{multi-select
|
||||
id=(concat "user-" this.elementId)
|
||||
content=this.field.options
|
||||
valueProperty=null
|
||||
nameProperty=null
|
||||
value=this.value
|
||||
none=this.noneLabel
|
||||
onChange=(action (mut this.value))
|
||||
}}
|
||||
<div class="instructions">{{html-safe this.field.description}}</div>
|
||||
</div>
|
|
@ -5095,6 +5095,7 @@ en:
|
|||
text: "Text Field"
|
||||
confirm: "Confirmation"
|
||||
dropdown: "Dropdown"
|
||||
multiselect: "Multiselect"
|
||||
|
||||
site_text:
|
||||
description: "You can customize any of the text on your forum. Please start by searching below:"
|
||||
|
|
Loading…
Reference in New Issue
Block a user