Amélioration liste de compétences

This commit is contained in:
Vincent Vandemeulebrouck 2024-10-05 14:39:56 +02:00
parent b866c95ebd
commit 0f7b9baf51
3 changed files with 8 additions and 8 deletions

View File

@ -292,6 +292,7 @@ export class RdDUtility {
Handlebars.registerHelper('array-includes', (array, value) => array.includes(value));
Handlebars.registerHelper('min', (...args) => Math.min(...args.slice(0, -1)));
Handlebars.registerHelper('isLastIndex', (index, list) => index+1 >= list.length);
Handlebars.registerHelper('regle-optionnelle', (option) => ReglesOptionnelles.isUsing(option));
Handlebars.registerHelper('trier', list => list.sort((a, b) => a.name.localeCompare(b.name)));
Handlebars.registerHelper('filtreTriCompetences', competences => RdDItemCompetence.triVisible(competences));

View File

@ -60,11 +60,11 @@
</div>
<hr>
<div>
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/competences.hbs" competences= competences}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/competences.hbs" competences=competences}}
</div>
<hr>
<div>
{{export.draconic.value}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/competences.hbs" competences=draconic }}
</div>
<hr>
<div>

View File

@ -1,10 +1,9 @@
{{#each competences as |group|}}
{{#if @index}}/{{/if}}
{{#each group.list as |comp|}}
{{#if @index}}, {{/if}}
<span class="item" data-item-id="{{comp._id}}">
<a class="roll-competence">{{comp.name}}</a>
</span>
{{#with group}}
{{#each list as |comp|}}
<span class="item" data-item-id="{{comp._id}}"><a class="roll-competence">{{comp.name}}</a></span>{{~#unless (isLastIndex @index ../list)~}},{{/unless~}}
{{/each}}
{{numberFormat group.niveau decimals=0 sign=true}}
{{numberFormat niveau decimals=0 sign=true}}
{{/with}}
{{/each}}