fix some person issues

This commit is contained in:
juminet
2021-12-12 14:39:59 +00:00
committed by Julien Fastré
parent 133ac67794
commit 7e045e964a
11 changed files with 52 additions and 13 deletions

View File

@@ -10,6 +10,7 @@
* addAge bool
* addCenter bool
* hLevel integer
* addDeath bool
* address_multiline bool
* customButtons [
'before' Twig\Markup, (injected with macro)
@@ -24,7 +25,12 @@
{% macro raw(person, options) %}
<span class="firstname">{{ person.firstName }}</span>
<span class="lastname">{{ person.lastName }}</span>
<span class="lastname">
{{ person.lastName }}
{%- if options['addDeath'] -%}
{% if person.deathdate is not null %} (‡){% endif %}
{% endif %}
</span>
{%- if options['addAltNames'] -%}
<span class="altnames">
{%- for n in person.altNames -%}
@@ -82,21 +88,17 @@
{{ 'Date of death'|trans }}:
{%- endif -%}
{#- must be on one line to avoid spaces with dash -#}
<time datetime="{{ person.deathdate|date('Y-m-d') }}" title="{{ 'Deathdate'|trans }}">{{ person.deathdate|format_date("medium") }}</time>
{% if options['addAge'] %}
<span class="age">
({{ 'years_old'|trans({ 'age': person.age }) }})
</span>
{% endif %}
<time datetime="{{ person.deathdate|date('Y-m-d') }}" title="{{ 'deathdate'|trans }}">{{ person.deathdate|format_date("medium") }}</time>
{%- if options['addAge'] -%}
<span class="age">{{ 'years_old'|trans({ 'age': person.age }) }}</span>
{%- endif -%}
{%- elseif person.birthdate is not null -%}
<time datetime="{{ person.birthdate|date('Y-m-d') }}" title="{{ 'Birthdate'|trans }}">
{{ 'Born the date'|trans({'gender': person.gender,
'birthdate': person.birthdate|format_date("medium") }) }}
</time>
{%- if options['addAge'] -%}
<span class="age">
{{- 'years_old'|trans({ 'age': person.age }) -}}
</span>
<span class="age">{{- 'years_old'|trans({ 'age': person.age }) -}}</span>
{%- endif -%}
{%- endif -%}
</p>