Showing age at death instead of age from birth on actor tiles.
This commit is contained in:
parent
48331c1c5a
commit
49f1bc9ce2
|
@ -40,13 +40,19 @@
|
||||||
<Gender :gender="actor.gender" />
|
<Gender :gender="actor.gender" />
|
||||||
|
|
||||||
<span
|
<span
|
||||||
v-if="actor.ageFromBirth"
|
v-if="actor.ageAtDeath"
|
||||||
|
:title="`Passed ${formatDate(actor.ageAtDeath, 'MMMM d, yyyy')}`"
|
||||||
|
class="age"
|
||||||
|
>{{ actor.ageAtDeath }} <Icon icon="tombstone" /></span>
|
||||||
|
|
||||||
|
<span
|
||||||
|
v-else-if="actor.ageFromBirth"
|
||||||
:title="`Born ${formatDate(actor.dateOfBirth, 'MMMM d, yyyy')}`"
|
:title="`Born ${formatDate(actor.dateOfBirth, 'MMMM d, yyyy')}`"
|
||||||
class="age"
|
class="age"
|
||||||
>{{ actor.ageFromBirth }}</span>
|
>{{ actor.ageFromBirth }}</span>
|
||||||
|
|
||||||
<span
|
<span
|
||||||
v-if="actor.ageThen && actor.ageThen < actor.ageFromBirth"
|
v-if="actor.ageThen && actor.ageThen < actor.ageFromBirth && (!actor.ageAtDeath || actor.ageThen < actor.ageAtDeath)"
|
||||||
title="Age on date of release"
|
title="Age on date of release"
|
||||||
class="age age-then"
|
class="age age-then"
|
||||||
>{{ actor.ageThen }}</span>
|
>{{ actor.ageThen }}</span>
|
||||||
|
@ -209,7 +215,16 @@ const favorited = ref(props.actor.stashes.some((actorStash) => actorStash.id ===
|
||||||
}
|
}
|
||||||
|
|
||||||
.age {
|
.age {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
margin-right: .25rem;
|
margin-right: .25rem;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: .8rem;
|
||||||
|
height: .8rem;
|
||||||
|
fill: var(--highlight-weak-10);
|
||||||
|
margin-left: .25rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.age-then {
|
.age-then {
|
||||||
|
|
|
@ -74,6 +74,9 @@ export function curateActor(actor, context = {}) {
|
||||||
ageFromBirth: actor.date_of_birth && actor.date_of_birth.getFullYear() > 1
|
ageFromBirth: actor.date_of_birth && actor.date_of_birth.getFullYear() > 1
|
||||||
? differenceInYears(Date.now(), actor.date_of_birth)
|
? differenceInYears(Date.now(), actor.date_of_birth)
|
||||||
: null,
|
: null,
|
||||||
|
ageAtDeath: actor.date_of_birth && actor.date_of_death && actor.date_of_birth.getFullYear() > 1
|
||||||
|
? differenceInYears(actor.date_of_death, actor.date_of_birth)
|
||||||
|
: null,
|
||||||
ageThen: context.sceneDate && actor.date_of_birth && actor.date_of_birth.getFullYear() > 1
|
ageThen: context.sceneDate && actor.date_of_birth && actor.date_of_birth.getFullYear() > 1
|
||||||
? differenceInYears(context.sceneDate, actor.date_of_birth)
|
? differenceInYears(context.sceneDate, actor.date_of_birth)
|
||||||
: null,
|
: null,
|
||||||
|
|
2
static
2
static
|
@ -1 +1 @@
|
||||||
Subproject commit 04c9d2175cf66bf3e286da6ffded79848a8d2488
|
Subproject commit 6534577c5755df26a90b318a3ea7e653636dfd35
|
Loading…
Reference in New Issue