Tri des alphabétique des compétences

Dans lmes sélections, c'est plus facile de s'y retrouver
This commit is contained in:
Vincent Vandemeulebrouck 2022-10-31 15:20:09 +01:00
parent f1d7cfa1f8
commit cf4be389b4
7 changed files with 7 additions and 7 deletions

View File

@ -280,7 +280,7 @@ export class RdDUtility {
Handlebars.registerHelper('typeTmr-name', coord => TMRUtility.typeTmrName(coord));
Handlebars.registerHelper('min', (...args) => Math.min(...args.slice(0, -1)));
Handlebars.registerHelper('regle-optionnelle', (option) => ReglesOptionelles.isUsing(option));
Handlebars.registerHelper('trier', competences => competences.sort((a, b) => a.name.localeCompare(b.name)));
Handlebars.registerHelper('filtreTriCompetences', competences => competences.filter(it => it.system.isVisible)
.sort((a, b) => {
if (a.name.startsWith("Survie") && b.name.startsWith("Survie")) {

View File

@ -1,5 +1,5 @@
<ol class="item-list alterne-list">
{{#each competences as |comp key|}}
{{#each (trier competences) as |comp key|}}
<li class="item flexrow list-item" data-item-id="{{comp._id}}">
<a class="competence-label">
<img class="sheet-competence-img" src="{{comp.img}}" />

View File

@ -22,7 +22,7 @@
</div>
</li>
{{/if}}
{{#each competences as |comp key|}}
{{#each (trier competences) as |comp key|}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence.html" comp}}
{{/each}}
</ul>

View File

@ -21,7 +21,7 @@
<label for="xp">Compétence</label>
<select name="system.competence" id="competenceselect" data-dtype="String">
{{#select system.competence}}
{{#each competences as |competence key|}}
{{#each (trier competences) as |competence key|}}
<option value="{{competence.name}}">{{competence.name}}</option>
{{/each}}
{{/select}}

View File

@ -6,7 +6,7 @@
<label for="xp">Compétence</label>
<select name="system.competence" id="competenceselect" data-dtype="String">
{{#select system.competence}}
{{#each competences as |competence key|}}
{{#each (trier competences) as |competence key|}}
<option value="{{competence.name}}">{{competence.name}}</option>
{{/each}}
{{/select}}

View File

@ -20,7 +20,7 @@
<label>Compétence</label>
<select name="system.competence" id="competenceselect" data-dtype="String">
{{#select system.competence}}
{{#each competences as |competence key|}}
{{#each (trier competences) as |competence key|}}
<option value="{{competence.name}}">{{competence.name}}</option>
{{/each}}
{{/select}}

View File

@ -17,7 +17,7 @@
<select name="system.competence" id="competenceselect" data-dtype="String">
{{#select system.competence}}
<option value="">Sans compétence</option>
{{#each competences as |competence key|}}
{{#each (trier competences) as |competence key|}}
<option value="{{competence.name}}">{{competence.name}}</option>
{{/each}}
{{/select}}