feat(falukant): enhance child details with other parent information and birth context
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:
Torsten Schulz (local)
2026-03-31 10:29:22 +02:00
parent 9b3898e43c
commit db0e80a559
6 changed files with 145 additions and 4 deletions

View File

@@ -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));