<ol class="groups-list">
    {{#each groups as |group groupKey|}}
    <li class="group" data-group="{{groupKey}}">
        <div class="group-header flexrow">
            <input class="group-key" type="text" readonly name="system.groups.{{groupKey}}.key" value="{{groupKey}}" />
            <input class="group-label" type="text" name="system.groups.{{groupKey}}.label" value="{{group.label}}" placeholder="Group Label" />
            <select class="group-dtype" name="system.groups.{{groupKey}}.dtype">
                {{#select group.dtype}}
                {{#each ../dtypes as |t|}}
                <option value="{{t}}">{{t}}</option>
                {{/each}}
                {{/select}}
            </select>
            <a class="attribute-control" data-action="create" data-group="{{groupKey}}" data-dtype="{{group.dtype}}"><i class="fas fa-plus"></i></a>
            <a class="group-control" data-action="delete-group"><i class="fas fa-trash"></i></a>
        </div>

        {{> "systems/worldbuilding/templates/parts/sheet-attributes.html" attributes=group.attributes group=groupKey dtypes=../dtypes}}
    </li>
    {{/each}}
</ol>
