From 0aadf4f9275c744b06d30c091b6808d44b3352b6 Mon Sep 17 00:00:00 2001 From: jalensailin Date: Tue, 5 Dec 2023 13:06:20 -0500 Subject: [PATCH] split out repeated html into hbs partial --- module/templates.js | 1 + templates/actor/actor-sheet.html | 36 ++-------------------- templates/actor/custom-skills-partial.html | 36 ++++++++++++++++++++++ templates/actor/npc-sheet.html | 36 +--------------------- templates/actor/unnatural-sheet.html | 36 +--------------------- 5 files changed, 41 insertions(+), 104 deletions(-) create mode 100644 templates/actor/custom-skills-partial.html diff --git a/module/templates.js b/module/templates.js index 33c6e19..7baa2eb 100644 --- a/module/templates.js +++ b/module/templates.js @@ -12,6 +12,7 @@ export default async function preloadHandlebarsTemplates() { "systems/deltagreen/templates/actor/unnatural-sheet.html", "systems/deltagreen/templates/actor/npc-sheet.html", "systems/deltagreen/templates/actor/cv-partial.html", + "systems/deltagreen/templates/actor/custom-skills-partial.html", "systems/deltagreen/templates/dialog/modify-percentile-roll.html", "systems/deltagreen/templates/actor/vehicle-sheet.html", "systems/deltagreen/templates/actor/help-and-licensing-partial.html", diff --git a/templates/actor/actor-sheet.html b/templates/actor/actor-sheet.html index 8cbe60a..ec3ffb8 100644 --- a/templates/actor/actor-sheet.html +++ b/templates/actor/actor-sheet.html @@ -137,41 +137,9 @@ {{/each}} + {{!-- Custom Skills and Special Training --}}
- -
- {{#each actor.system.typedSkills as |skill key|}} -
- - - -
- - -
-
- {{/each}} - {{#each actor.system.specialTraining as |training|}} -
- -
- - -
-
- {{/each}} -
+ {{> "systems/deltagreen/templates/actor/custom-skills-partial.html" actorType="agent"}}
diff --git a/templates/actor/custom-skills-partial.html b/templates/actor/custom-skills-partial.html new file mode 100644 index 0000000..1613c83 --- /dev/null +++ b/templates/actor/custom-skills-partial.html @@ -0,0 +1,36 @@ +
+ {{localize 'DG.Skills.AddTypedOrCustomSkill'}} + {{localize 'Add Special Training'}} + {{#if_eq actorType "agent"}} + {{localize 'DG.Skills.ApplySkillImprovements'}} + {{/if_eq}} +
+
+ {{#each actor.system.typedSkills as |skill key|}} +
+ + + +
+ + +
+
+ {{/each}} + {{#each actor.system.specialTraining as |training|}} +
+ +
+ + +
+
+ {{/each}} +
\ No newline at end of file diff --git a/templates/actor/npc-sheet.html b/templates/actor/npc-sheet.html index 427db2f..081c60e 100644 --- a/templates/actor/npc-sheet.html +++ b/templates/actor/npc-sheet.html @@ -128,41 +128,7 @@
- -
- {{#each actor.system.typedSkills as |skill key|}} - {{#if (hideSkillBasedOnProficiencyAndUserChoice ../actor.system.showUntrainedSkills skill.proficiency)}} -
- - - -
- - -
-
- {{/if}} - {{/each}} - {{#each actor.system.specialTraining as |training|}} -
- -
- - -
-
- {{/each}} -
+ {{> "systems/deltagreen/templates/actor/custom-skills-partial.html"}}

diff --git a/templates/actor/unnatural-sheet.html b/templates/actor/unnatural-sheet.html index b5b3b9f..99ca73f 100644 --- a/templates/actor/unnatural-sheet.html +++ b/templates/actor/unnatural-sheet.html @@ -121,41 +121,7 @@

- -
- {{#each actor.system.typedSkills as |skill key|}} - {{#if (hideSkillBasedOnProficiencyAndUserChoice ../actor.system.showUntrainedSkills skill.proficiency)}} -
- - - -
- - -
-
- {{/if}} - {{/each}} - {{#each actor.system.specialTraining as |training|}} -
- -
- - -
-
- {{/each}} -
+ {{> "systems/deltagreen/templates/actor/custom-skills-partial.html"}}