From ff7197455c5f1f88876c73a77749733f5bb269cc Mon Sep 17 00:00:00 2001 From: Megastruktur Date: Mon, 4 Jan 2021 17:27:11 +0300 Subject: [PATCH] GH-91 - Closes #91 - Fixes Edges and Flaws selection for Cohorts --- template.json | 24 ++++++++++++++++-------- templates/items/cohort.html | 14 ++++++-------- templates/parts/cohort-block.html | 16 ++++++++-------- 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/template.json b/template.json index 8dfe309..bcd81b5 100644 --- a/template.json +++ b/template.json @@ -237,38 +237,46 @@ "edges_list": { "Fearsome": { "label": "BITD.EdgesFearsome", - "description": "BITD.EdgesFearsomeDescription" + "description": "BITD.EdgesFearsomeDescription", + "selected": false }, "Independent": { "label": "BITD.EdgesIndependent", - "description": "BITD.EdgesIndependentDescription" + "description": "BITD.EdgesIndependentDescription", + "selected": false }, "Loyal": { "label": "BITD.EdgesLoyal", - "description": "BITD.EdgesLoyalDescription" + "description": "BITD.EdgesLoyalDescription", + "selected": false }, "Tenacious": { "label": "BITD.EdgesTenacious", - "description": "BITD.EdgesTenaciousDescription" + "description": "BITD.EdgesTenaciousDescription", + "selected": false } }, "flaws": [], "flaws_list": { "Principled": { "label": "BITD.FlawsPrincipled", - "description": "BITD.FlawsPrincipledDescription" + "description": "BITD.FlawsPrincipledDescription", + "selected": false }, "Savage": { "label": "BITD.FlawsSavage", - "description": "BITD.FlawsSavageDescription" + "description": "BITD.FlawsSavageDescription", + "selected": false }, "Unreliable": { "label": "BITD.FlawsUnreliable", - "description": "BITD.FlawsUnreliableDescription" + "description": "BITD.FlawsUnreliableDescription", + "selected": false }, "Wild": { "label": "BITD.FlawsWild", - "description": "BITD.FlawsWildDescription" + "description": "BITD.FlawsWildDescription", + "selected": false } }, "harm": ["No"], diff --git a/templates/items/cohort.html b/templates/items/cohort.html index 9c393c2..09121de 100644 --- a/templates/items/cohort.html +++ b/templates/items/cohort.html @@ -74,24 +74,22 @@
{{localize "BITD.Edges"}}
{{#each data.edges_list as |edge key|}} - {{#multiboxes ../data.edges}}
- - + +
- {{/multiboxes}} {{/each}}
{{localize "BITD.Flaws"}}
{{#each data.flaws_list as |flaw key|}} - {{#multiboxes ../data.flaws}}
- - + +
- {{/multiboxes}} {{/each}}
diff --git a/templates/parts/cohort-block.html b/templates/parts/cohort-block.html index 3ac0ffd..7c94a6d 100644 --- a/templates/parts/cohort-block.html +++ b/templates/parts/cohort-block.html @@ -27,15 +27,15 @@
- {{#each item.data.edges as |edge key|}} - {{#with (lookup ../item.data.edges_list edge)}} -
{{localize description}} ({{localize label}})
- {{/with}} + {{#each item.data.edges_list as |edge key|}} + {{#if edge.selected }} +
{{localize edge.description}} ({{localize edge.label}})
+ {{/if}} {{/each}} - {{#each item.data.flaws as |flaw key|}} - {{#with (lookup ../item.data.flaws_list flaw)}} -
{{localize description}} ({{localize label}})
- {{/with}} + {{#each item.data.flaws_list as |flaw key|}} + {{#if flaw.selected }} +
{{localize flaw.description}} ({{localize flaw.label}})
+ {{/if}} {{/each}}