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:
Krzysztof Kotlarek 2021-06-29 16:29:25 +10:00 committed by GitHub
parent a6363170e9
commit a69839689d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 0 deletions

View File

@ -15,6 +15,7 @@ UserField.reopenClass({
UserFieldType.create({ id: "text" }), UserFieldType.create({ id: "text" }),
UserFieldType.create({ id: "confirm" }), UserFieldType.create({ id: "confirm" }),
UserFieldType.create({ id: "dropdown", hasOptions: true }), UserFieldType.create({ id: "dropdown", hasOptions: true }),
UserFieldType.create({ id: "multiselect", hasOptions: true }),
]; ];
} }

View File

@ -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>

View File

@ -5095,6 +5095,7 @@ en:
text: "Text Field" text: "Text Field"
confirm: "Confirmation" confirm: "Confirmation"
dropdown: "Dropdown" dropdown: "Dropdown"
multiselect: "Multiselect"
site_text: site_text:
description: "You can customize any of the text on your forum. Please start by searching below:" description: "You can customize any of the text on your forum. Please start by searching below:"