mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 23:23:51 +00:00
[person bloc] handle null values in date + improve layout on dead person
and age
This commit is contained in:
@@ -60,23 +60,32 @@
|
||||
<i class="fa fa-fw {{ gender }}" title="{{ genderTitle|trans }}"></i>
|
||||
|
||||
{%- if person.deathdate is not null -%}
|
||||
|
||||
{%- if person.birthdate is not null -%}
|
||||
<time datetime="{{ person.birthdate|date('Y-m-d') }}" title="{{ 'birthdate'|trans|e('html_attr') }}">
|
||||
{{ person.birthdate|format_date("medium") }}
|
||||
</time>
|
||||
-
|
||||
{%- else -%}
|
||||
{{ 'Date of death'|trans }}:
|
||||
{%- endif -%}
|
||||
<time datetime="{{ person.deathdate|date('Y-m-d') }}" title="{{ 'Deathdate'|trans }}">
|
||||
{{ 'Date of death'|trans({'deathdate': person.deathdate|format_date("medium") }) }}
|
||||
{{ person.deathdate|format_date("medium") }}
|
||||
</time>
|
||||
|
||||
|
||||
{%- else -%}
|
||||
{% 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 }) }}
|
||||
({{ 'years_old'|trans({ 'age': person.age }) }})
|
||||
</span>
|
||||
{%- endif -%}
|
||||
|
||||
{%- endif -%}
|
||||
</p>
|
||||
{%- endif -%}
|
||||
@@ -141,7 +150,7 @@
|
||||
{{ options['customButtons']['replace'] }}
|
||||
{%- elseif is_granted('CHILL_PERSON_SEE', person) -%}
|
||||
<li>
|
||||
<a class="btn btn-sm btn-show" target="_blank" title="{{ 'Show person'|trans }}"
|
||||
<a class="btn btn-sm btn-show" title="{{ 'Show person'|trans }}"
|
||||
href="{{ path('chill_person_view', { person_id: person.id }) }}"></a>
|
||||
</li>
|
||||
{%- else -%}
|
||||
|
Reference in New Issue
Block a user