feat(falukant): enhance child details with other parent information and birth context
All checks were successful
Deploy to production / deploy (push) Successful in 3m2s
All checks were successful
Deploy to production / deploy (push) Successful in 3m2s
- Updated FalukantService to include father and mother character IDs in child relationships. - Added logic to retrieve and display other parent details in ChildDetailsDialog and FamilyView components. - Introduced new translations for 'other parent' and 'birth context' in English, German, and Spanish localization files. - Enhanced UI to show other parent information and birth context in child detail views.
This commit is contained in:
@@ -27,6 +27,14 @@
|
||||
<td>{{ $t('falukant.family.children.gender') }}</td>
|
||||
<td>{{ $t(`falukant.titles.${child.gender}.noncivil`) }}</td>
|
||||
</tr>
|
||||
<tr v-if="child.birthContext">
|
||||
<td>{{ $t('falukant.family.children.birthContextLabel') }}</td>
|
||||
<td>{{ $t('falukant.family.children.birthContextLong.' + child.birthContext) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ $t('falukant.family.children.otherParent') }}</td>
|
||||
<td>{{ otherParentDisplay }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ $t('falukant.family.children.heir') }}</td>
|
||||
<td>
|
||||
@@ -58,6 +66,16 @@ export default {
|
||||
child: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
otherParentDisplay() {
|
||||
if (!this.child?.otherParent) {
|
||||
return this.$t('falukant.family.children.otherParentUnknown');
|
||||
}
|
||||
const o = this.child.otherParent;
|
||||
const title = this.$t(`falukant.titles.${o.gender}.${o.nobleTitle}`);
|
||||
return `${title} ${o.firstName}`.trim();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open(child) {
|
||||
this.child = child;
|
||||
|
||||
@@ -659,6 +659,17 @@
|
||||
"acknowledged_bastard": "Anerkannt unehelich",
|
||||
"hidden_bastard": "Unehelich"
|
||||
},
|
||||
"otherParent": "Anderes Elternteil",
|
||||
"otherParentUnknown": "Unbekannt",
|
||||
"birthContextLabel": "Herkunft",
|
||||
"birthContextShort": {
|
||||
"marriage": "Ehe",
|
||||
"lover": "Liebschaft"
|
||||
},
|
||||
"birthContextLong": {
|
||||
"marriage": "Aus der Ehe",
|
||||
"lover": "Aus einer Liebschaft"
|
||||
},
|
||||
"details": {
|
||||
"title": "Kind-Details"
|
||||
}
|
||||
|
||||
@@ -653,10 +653,21 @@
|
||||
"acknowledged_bastard": "Acknowledged illegitimate",
|
||||
"hidden_bastard": "Illegitimate"
|
||||
},
|
||||
"otherParent": "Other parent",
|
||||
"otherParentUnknown": "Unknown",
|
||||
"birthContextLabel": "Origin",
|
||||
"birthContextShort": {
|
||||
"marriage": "Marriage",
|
||||
"lover": "Affair"
|
||||
},
|
||||
"birthContextLong": {
|
||||
"marriage": "From marriage",
|
||||
"lover": "From an affair"
|
||||
},
|
||||
"details": {
|
||||
"title": "Child Details"
|
||||
}
|
||||
,
|
||||
},
|
||||
"taxes": {
|
||||
"title": "Taxes",
|
||||
"loading": "Loading tax data...",
|
||||
@@ -665,7 +676,6 @@
|
||||
"region": "Region",
|
||||
"taxPercent": "Tax %"
|
||||
}
|
||||
}
|
||||
},
|
||||
"spouse": {
|
||||
"traitsToggle": "Character traits",
|
||||
|
||||
@@ -640,6 +640,17 @@
|
||||
"acknowledged_bastard": "Ilegítimo reconocido",
|
||||
"hidden_bastard": "Ilegítimo"
|
||||
},
|
||||
"otherParent": "Otro progenitor",
|
||||
"otherParentUnknown": "Desconocido",
|
||||
"birthContextLabel": "Origen",
|
||||
"birthContextShort": {
|
||||
"marriage": "Matrimonio",
|
||||
"lover": "Amorío"
|
||||
},
|
||||
"birthContextLong": {
|
||||
"marriage": "Del matrimonio",
|
||||
"lover": "De una relación amorosa"
|
||||
},
|
||||
"details": {
|
||||
"title": "Detalles del hijo"
|
||||
}
|
||||
|
||||
@@ -278,6 +278,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ $t('falukant.family.children.name') }}</th>
|
||||
<th>{{ $t('falukant.family.children.otherParent') }}</th>
|
||||
<th>{{ $t('falukant.family.children.age') }}</th>
|
||||
<th>{{ $t('falukant.family.children.heir') }}</th>
|
||||
<th>{{ $t('falukant.family.children.actions') }}</th>
|
||||
@@ -295,6 +296,15 @@
|
||||
<button @click="jumpToChurchForm">{{ $t('falukant.family.children.baptism')
|
||||
}}</button>
|
||||
</td>
|
||||
<td class="child-other-parent-cell">
|
||||
<span class="child-other-parent-name">{{ formatOtherParentLine(child) }}</span>
|
||||
<span
|
||||
v-if="child.birthContext"
|
||||
class="child-origin-badge child-origin-badge--context"
|
||||
>
|
||||
{{ birthContextShortLabel(child.birthContext) }}
|
||||
</span>
|
||||
</td>
|
||||
<td>{{ child.age }}</td>
|
||||
<td>
|
||||
<span v-if="child.isHeir" class="heir-badge">{{ $t('falukant.family.children.isHeir') }}</span>
|
||||
@@ -720,6 +730,21 @@ export default {
|
||||
this.$refs.childDetailsDialog?.open(child);
|
||||
},
|
||||
|
||||
formatOtherParentLine(child) {
|
||||
if (!child?.otherParent) {
|
||||
return this.$t('falukant.family.children.otherParentUnknown');
|
||||
}
|
||||
const o = child.otherParent;
|
||||
const title = this.$t(`falukant.titles.${o.gender}.${o.nobleTitle}`);
|
||||
return `${title} ${o.firstName}`.trim();
|
||||
},
|
||||
|
||||
birthContextShortLabel(context) {
|
||||
const key = `falukant.family.children.birthContextShort.${context}`;
|
||||
const t = this.$t(key);
|
||||
return t === key ? context : t;
|
||||
},
|
||||
|
||||
async setAsHeir(child) {
|
||||
if (!child.childCharacterId) {
|
||||
showError(this, 'tr:falukant.family.children.heirSetError');
|
||||
@@ -1218,6 +1243,20 @@ export default {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.child-origin-badge--context {
|
||||
margin-left: 6px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.child-other-parent-cell {
|
||||
max-width: 14rem;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.child-other-parent-name {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.lovers-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
|
||||
|
||||
Reference in New Issue
Block a user