From 2cb04112880f84d884168cff057af51388fd7574 Mon Sep 17 00:00:00 2001
From: Johannes Loher <johannes.loher@fg4f.de>
Date: Sun, 3 Jan 2021 23:26:31 +0100
Subject: [PATCH] Add basic form of editable profile fields to profile tab

---
 src/module/config.ts                     | 15 +++++++++++++++
 src/templates/actor/partials/profile.hbs | 12 +++++++++++-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/src/module/config.ts b/src/module/config.ts
index deafe0db..c5c1dea3 100644
--- a/src/module/config.ts
+++ b/src/module/config.ts
@@ -170,4 +170,19 @@ export const DS4 = {
         eyeColor: "DS4.ProfileEyeColor",
         specialCharacteristics: "DS4.ProfileSpecialCharacteristics",
     },
+
+    /**
+     * Define the profile info types for hanndlebars of a character
+     */
+    profileDTypes: {
+        gender: "String",
+        birthday: "String",
+        birthplace: "String",
+        age: "Number",
+        height: "Number",
+        hairColor: "String",
+        weight: "Number",
+        eyeColor: "String",
+        specialCharacteristics: "String",
+    },
 };
diff --git a/src/templates/actor/partials/profile.hbs b/src/templates/actor/partials/profile.hbs
index 4755d267..def5d419 100644
--- a/src/templates/actor/partials/profile.hbs
+++ b/src/templates/actor/partials/profile.hbs
@@ -1 +1,11 @@
-<div class="tab profile" data-group="primary" data-tab="profile"></div>
\ No newline at end of file
+<div class="tab profile" data-group="primary" data-tab="profile">
+    <div class="grid grid-2col">
+        {{#each data.profile as |profile-data-value profile-data-key|}}
+        <div class="profile-entry">
+            <label>{{lookup ../config.profile profile-data-key}}</label>
+            <input type="text" name="data.profile.{{profile-data-key}}" value="{{profile-data-value}}"
+                data-dtype="{{lookup ../config/profileDTypes profile-data-key}}" />
+        </div>
+        {{/each}}
+    </div>
+</div>
\ No newline at end of file