Filtrer les catégories sans compétences

This commit is contained in:
Vincent Vandemeulebrouck 2022-08-27 22:48:08 +02:00
parent 6e361a5531
commit e4da124579
2 changed files with 61 additions and 55 deletions

View File

@ -239,7 +239,8 @@ export class RdDUtility {
Handlebars.registerHelper('typeTmr-name', coord => TMRUtility.typeTmrName(coord));
Handlebars.registerHelper('min', (...args) => Math.min(...args.slice(0, -1)));
Handlebars.registerHelper('sortCompetence', competences => competences.sort((a, b) => {
Handlebars.registerHelper('filtreTriCompetences', competences => competences.filter(it => it.visible)
.sort((a, b) => {
if (a.name.startsWith("Survie") && b.name.startsWith("Survie")) {
if (a.name.includes("Cité")) return -1;
if (b.name.includes("Cité")) return 1;
@ -268,7 +269,8 @@ export class RdDUtility {
return a.name.localeCompare(b.name);
}
return a.name.localeCompare(b.name);
}));
})
);
return loadTemplates(templatePaths);
}

View File

@ -1,3 +1,5 @@
{{#if competences}}
<div class="flex-shrink">
<header class="competence-header flexrow">
<span class="competence-title">{{categorie}}</span>
</header>
@ -25,3 +27,5 @@
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-competence-partial.html" comp}}
{{/each}}
</ul>
</div>
{{/if}}