change Talent.system.kategorie to be choices based and use DSA41_input

This commit is contained in:
Sven Balzer 2025-05-04 11:15:31 +02:00
parent a6dc61a924
commit f6518cba74
2 changed files with 12 additions and 8 deletions

View File

@ -5,13 +5,7 @@
<div class="grid3 gap">
{{>editable-input type="text" name="name" value=item.name placeholder=(localize "DSA41.name")}}
<div>
<select name="system.kategorie">
<option value="koerperliche" {{#if (eq item.system.kategorie "koerperliche") }}selected{{/if}}>{{localize "DSA41.talente.koerperliche.label"}} </option>
<option value="gesellschaftliche" {{#if (eq item.system.kategorie "gesellschaftliche")}}selected{{/if}}>{{localize "DSA41.talente.gesellschaftliche.label"}}</option>
<option value="natur" {{#if (eq item.system.kategorie "natur") }}selected{{/if}}>{{localize "DSA41.talente.natur.label"}} </option>
<option value="wissens" {{#if (eq item.system.kategorie "wissens") }}selected{{/if}}>{{localize "DSA41.talente.wissens.label"}} </option>
<option value="handwerks" {{#if (eq item.system.kategorie "handwerks") }}selected{{/if}}>{{localize "DSA41.talente.handwerks.label"}} </option>
</select>
{{DSA41_input "system.kategorie"}}
<div class="placeholder">{{localize "DSA41.talente.label_kategorie"}}</div>
</div>
{{>editable-input type="text" name="system.behinderung" value=item.system.behinderung placeholder=(localize "DSA41.talente.label_behinderung")}}

View File

@ -753,7 +753,17 @@ class DSA41_BewaffnungData extends TypeDataModel {
class DSA41_TalentData extends TypeDataModel {
static defineSchema() {
return {
kategorie: new StringField({ initial: "koerperliche" }),
kategorie: new StringField({
required: true,
choices: {
"koerperliche": "DSA41.talente.koerperliche.label",
"gesellschaftliche": "DSA41.talente.gesellschaftliche.label",
"natur": "DSA41.talente.natur.label",
"wissens": "DSA41.talente.wissens.label",
"handwerks": "DSA41.talente.handwerks.label",
},
initial: "koerperliche"
}),
behinderung: new StringField({ initial: "" }),
attribute1: new AttributeChoiceField(),