ds4/templates/dialogs/simple-select-form.hbs

29 lines
1 KiB
Handlebars
Raw Normal View History

2021-06-26 22:02:00 +02:00
{{!--
SPDX-FileCopyrightText: 2021 Johannes Loher
SPDX-License-Identifier: MIT
--}}
{{!--
2021-05-13 21:39:42 +02:00
!-- Render a simple form with select elements. It uses the default form classes of Foundry VTT.
!-- @param selects: An array of objects that each contain the following:
!---- identifier: The identifier to use as id for the select element. Can be used to query the value later on.
!---- label: Text to display as the label for the select element.
!---- options: Key-value pairs that describe the options. The keys are used for the value attribute of the
options, the values are used as content.
--}}
<form class="ds4-simple-form">
2021-05-13 21:39:42 +02:00
{{#each selects}}
<div class="form-group">
<label for="{{identifier}}">{{label}}</label>
<div class="form-fields">
<select name="{{identifier}}" id="{{identifier}}">
{{#each options as | value key |}}
<option value="{{key}}">{{value}}</option>
{{/each}}
</select>
</div>
</div>
2021-05-13 21:39:42 +02:00
{{/each}}
</form>