- Closes #91
- Fixes Edges and Flaws selection for Cohorts
This commit is contained in:
Megastruktur 2021-01-04 17:27:11 +03:00
parent a7921e1778
commit ff7197455c
3 changed files with 30 additions and 24 deletions

View file

@ -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"],

View file

@ -74,24 +74,22 @@
<div class="edgeflaw-container flex-vertical">
<div class="label-stripe">{{localize "BITD.Edges"}}</div>
{{#each data.edges_list as |edge key|}}
{{#multiboxes ../data.edges}}
<div class="edgeflaw flex-horizontal">
<input id="edge-{{key}}" type="checkbox" name="data.edges" value="{{key}}">
<label for="edge-{{key}}">{{localize edge.label}}</label>
<input id="cohort-{{item._id}}-edge-{{key}}" type="checkbox" name="data.edges_list.{{key}}.selected"
{{checked edge.selected}}>
<label for="cohort-{{item._id}}-edge-{{key}}">{{localize edge.label}}</label>
</div>
{{/multiboxes}}
{{/each}}
</div>
<div class="edgeflaw-container flex-vertical">
<div class="label-stripe">{{localize "BITD.Flaws"}}</div>
{{#each data.flaws_list as |flaw key|}}
{{#multiboxes ../data.flaws}}
<div class="edgeflaw flex-horizontal">
<input id="flaw-{{key}}" type="checkbox" name="data.flaws" value="{{key}}">
<label for="flaw-{{key}}">{{localize flaw.label}}</label>
<input id="cohort-{{item._id}}-flaw-{{key}}" type="checkbox" name="data.flaws_list.{{key}}.selected"
{{checked flaw.selected}}>
<label for="cohort-{{item._id}}-flaw-{{key}}">{{localize flaw.label}}</label>
</div>
{{/multiboxes}}
{{/each}}
</div>

View file

@ -27,15 +27,15 @@
<div class="flex-vertical">
<div class="flex-vertical">
{{#each item.data.edges as |edge key|}}
{{#with (lookup ../item.data.edges_list edge)}}
<div class="description">{{localize description}} <b>({{localize label}})</b></div>
{{/with}}
{{#each item.data.edges_list as |edge key|}}
{{#if edge.selected }}
<div class="description">{{localize edge.description}} <b>({{localize edge.label}})</b></div>
{{/if}}
{{/each}}
{{#each item.data.flaws as |flaw key|}}
{{#with (lookup ../item.data.flaws_list flaw)}}
<div class="description">{{localize description}} <b>({{localize label}})</b></div>
{{/with}}
{{#each item.data.flaws_list as |flaw key|}}
{{#if flaw.selected }}
<div class="description">{{localize flaw.description}} <b>({{localize flaw.label}})</b></div>
{{/if}}
{{/each}}
</div>
</div>