<form autocomplete="off">
    <div class="form-group">
        <select name="spell">
            {{#each spells as |section lvl|}}
                <optgroup label="{{localize "PF2E.LevelN" level=lvl}}">
                    {{#each section as |spell|}}
                        <option value="{{spell.id}}">{{spell.name}}</option>
                    {{/each}}
                </optgroup>
            {{/each}}
        </select>
    </div>
</form>
