v12 fixes : Fix select to selectOptions

This commit is contained in:
Vlyan
2024-05-24 18:44:24 +02:00
parent fcc2691f4b
commit 3b37859cb5
12 changed files with 87 additions and 201 deletions

View File

@@ -8,36 +8,24 @@
{{!-- Attributes Tab --}}
<article class="attributes" data-group="primary" data-tab="attributes">
<select name="system.advancement_type" id="advancement_type">
{{#select data.system.advancement_type}}
{{#each data.subTypesList as |label type|}}
<option value="{{type}}">{{localize label}}</option>
{{/each}}
{{/select}}
{{selectOptions data.subTypesList selected=data.system.advancement_type valueAttr='id' labelAttr='label' localize=true}}
</select>
{{#ifCond data.system.advancement_type '==' 'ring'}}
<select name="system.ring" id="advancement_ring">
{{#select data.system.ring}}
{{#each data.ringsList as |obj|}}
<option value="{{obj.id}}">{{obj.label}}</option>
{{/each}}
{{/select}}
{{selectOptions data.ringsList selected=data.system.ring valueAttr='id' labelAttr='label'}}
</select>
{{/ifCond}}
{{#ifCond data.system.advancement_type '==' 'skill'}}
<select name="system.skill" id="advancement_skill">
<option value="">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#select data.system.skill}}
{{#each data.skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}">
{{#each skills as |obj|}}
<option value="{{obj.id}}">{{obj.label}}</option>
{{/each}}
</optgroup>
{{/each}}
{{/select}}
</select>
<select name="system.skill" id="advancement_skill">
<option value="">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#each data.skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}">
{{selectOptions skills selected=../data.system.skill valueAttr='id' labelAttr='label'}}
</optgroup>
{{/each}}
</select>
{{/ifCond}}
<label class="cursus attribute-value checkbox">
<input type="checkbox" name="system.in_curriculum" {{checked data.system.in_curriculum}} />