Skip to content

Commit

Permalink
fix: All item sheets should have description and shortDescription on …
Browse files Browse the repository at this point in the history
…them, including skills (for which I added a migration).
  • Loading branch information
xdy committed Sep 19, 2020
1 parent 55b9c0b commit d2022aa
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/module/migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ export class Migration {
}
}

if (before(systemMigrationVersion, "0.6.23")) {
if (item.type === 'skills') {
updateData['data.description'] = "";
updateData['data.shortDesc'] = "";
}
}

return updateData;
}
Expand Down
4 changes: 3 additions & 1 deletion static/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,9 @@
"name": "Skill Name",
"value": -3,
"characteristic": "STR",
"type": "skills"
"type": "skills",
"description": "",
"shortdescr": ""
}
}
}
11 changes: 11 additions & 0 deletions static/templates/items/armor-sheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,16 @@
<input id="data.weight" type="text" name="data.weight" value="{{data.weight}}" data-dtype="Number"/>
</label>
</div>

<div class="item-short">
<label for="data.shortdescr" class="resource-label">{{localize "TWODSIX.Items.Equipment.ShortDescription"}}
<input id="data.shortdescr" type="text" name="data.shortdescr" value="{{data.shortdescr}}"/>
</label>
</div>

<div class="item-descr">
<span class="resource-label">{{localize "TWODSIX.Items.Equipment.Description"}}</span>
<div contenteditable="true" data-edit="data.description">{{{data.description}}}</div>
</div>
</div>
</form>
6 changes: 6 additions & 0 deletions static/templates/items/augment-sheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@

</div>

<div class="item-short">
<label for="data.shortdescr" class="resource-label">{{localize "TWODSIX.Items.Equipment.ShortDescription"}}
<input id="data.shortdescr" type="text" name="data.shortdescr" value="{{data.shortdescr}}"/>
</label>
</div>

<div class="item-descr">
<span class="resource-label">{{localize "TWODSIX.Items.Equipment.Description"}}</span>
<div contenteditable="true" data-edit="data.description">{{{data.description}}}</div>
Expand Down
10 changes: 10 additions & 0 deletions static/templates/items/skills-sheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@
</div>
<span class="total-output flex1 skill-mod"></span>

<div class="item-short">
<label for="data.shortdescr" class="resource-label">{{localize "TWODSIX.Items.Equipment.ShortDescription"}}
<input id="data.shortdescr" type="text" name="data.shortdescr" value="{{data.shortdescr}}"/>
</label>
</div>

<div class="item-descr">
<span class="resource-label">{{localize "TWODSIX.Items.Equipment.Description"}}</span>
<div contenteditable="true" data-edit="data.description">{{{data.description}}}</div>
</div>
</div>
</form>

Expand Down
7 changes: 7 additions & 0 deletions static/templates/items/weapon-sheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,16 @@
</label>
</div>

<div class="item-short">
<label for="data.shortdescr" class="resource-label">{{localize "TWODSIX.Items.Equipment.ShortDescription"}}
<input id="data.shortdescr" type="text" name="data.shortdescr" value="{{data.shortdescr}}"/>
</label>
</div>

<div class="item-descr">
<span class="resource-label">{{localize "TWODSIX.Items.Equipment.Description"}}</span>
<div contenteditable="true" data-edit="data.description">{{{data.description}}}</div>
</div>

</div>
</form>

0 comments on commit d2022aa

Please sign in to comment.