Use place_name where possible

This commit is contained in:
David Straub
2025-06-10 16:00:47 +00:00
parent e84d0969af
commit 2a25f663d7
5 changed files with 15 additions and 12 deletions

View File

@@ -82,7 +82,8 @@ export class GrampsjsEvent extends GrampsjsObject {
<a
href="${BASE_DIR}/place/${this.data.extended.place
.gramps_id}"
>${this.data.profile.place}</a
>${this.data.profile.place_name ||
this.data.profile.place}</a
>
</dd>
</div>

View File

@@ -73,7 +73,8 @@ export class GrampsjsPerson extends GrampsjsObject {
return html`
<span class="event">
<i>${asteriskIcon}</i>
${obj.date || ''} ${obj.place ? this._('in') : ''} ${obj.place || ''}
${obj.date || ''} ${obj.place ? this._('in') : ''}
${obj.place_name || obj.place || ''}
</span>
`
}
@@ -84,12 +85,11 @@ export class GrampsjsPerson extends GrampsjsObject {
return ''
}
return html`
<span class="event">
<i>${crossIcon}</i>
${obj.date || ''}
${obj.place ? this._('in') : ''}
${obj.place || ''}
</event>
<span class="event">
<i>${crossIcon}</i>
${obj.date || ''} ${obj.place ? this._('in') : ''}
${obj.place_name || obj.place || ''}
</span>
`
}

View File

@@ -357,7 +357,7 @@ export function objectDetail(type, obj, strings) {
return `
${obj?.profile?.birth?.date ? `* ${obj.profile.birth.date}` : ''}${
obj?.profile?.birth?.place && obj?.profile?.birth?.date ? ', ' : ''
}${obj?.profile?.birth?.place || ''}
}${obj?.profile?.birth?.place_name || obj?.profile?.birth?.place || ''}
`
// case 'family':
// return ''
@@ -365,7 +365,7 @@ export function objectDetail(type, obj, strings) {
return `
${obj?.profile?.date || ''}${
obj?.profile?.place && obj?.profile?.date ? ', ' : ''
}${obj?.profile?.place || ''}
}${obj?.profile?.place_name || obj?.profile?.place || ''}
`
case 'place':
return `

View File

@@ -98,7 +98,9 @@ export class GrampsjsViewAnniversaries extends GrampsjsConnectedComponent {
timestamp="${timestamp}"
locale="${this.appState.i18n.lang}"
></grampsjs-timedelta
>${event?.profile?.place ? html`, ${event.profile.place}` : ''}
>${event?.profile?.place
? html`, ${event.profile.place_name || event.profile.place}`
: ''}
</span>
</mwc-list-item>
`

View File

@@ -71,7 +71,7 @@ export class GrampsjsViewEvents extends GrampsjsViewObjectsBase {
grampsId: row.gramps_id,
type: row?.profile?.type,
date: row?.profile?.date,
place: row?.profile?.place,
place: row?.profile?.place_name || row?.profile?.place,
change: prettyTimeDiffTimestamp(row.change, this.appState.i18n.lang),
}
return formattedRow