{# * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} {% extends "@ChillPerson/Person/layout.html.twig" %} {% set activeRouteKey = 'chill_person_view' %} {# This view should receive those arguments: - person #} {% block title %}{{ 'Person details'|trans|capitalize ~ ' ' ~ person|chill_entity_render_string }}{% endblock %} {# we define variables to include an edit form repeated multiple time across the page #} {% set edit_tmp_name = 'ChillPersonBundle:Form:go_to_form.html.twig' %} {% set edit_tmp_args = { 'form_path_args' : { 'person_id': person.id }, 'form_path_key' : 'chill_person_general_edit' } %} {% block content %}
{% if person.memo is not empty and chill_person.fields.memo == 'visible' %}

{{ 'Memo'|trans }}

{{ person.memo|chill_markdown_to_html }}
{% endif %}

{{ 'General information'|trans }}

{% if person.civility is not null %}
{{ 'Civility'|trans }} :
{% if person.civility.name|length > 0 %} {{ person.civility.name|first }} {% endif %}
{% endif %}
{{ 'First name'|trans }} :
{{ person.firstName }}
{{ 'Last name'|trans }} :
{{ person.lastName }}
{% for el in person.altNames %} {% if el.key in alt_names|keys %}
{{ alt_names[el.key]|localize_translatable_string }} :
{{ el.label }}
{% endif %} {% endfor %}
{{ 'Gender'|trans }} :
{{ ( person.gender|default('Not given'))|trans }}

 {{ 'Birth information'|trans }}

{{ 'Date of birth'|trans }} :
{%- if person.birthdate is not null -%} {{ person.birthdate|format_date('long') }} {%- else -%} {{ 'Unknown date of birth'|trans }} {%- endif -%}
{%- if chill_person.fields.deathdate == 'visible' -%} {%- if person.deathdate is not null -%}
{{ 'Date of death'|trans }} :
{{ person.deathdate|format_date('long') }}
{%- endif -%} {%- endif -%} {%- if chill_person.fields.place_of_birth == 'visible' -%}
{{ 'Place of birth'|trans }} :
{% if person.placeOfBirth is not empty %}
{{ person.placeOfBirth }}
{% else %}
{{ 'Not given'|trans }}
{% endif %} {%- endif -%} {%- if chill_person.fields.country_of_birth == 'visible' -%}
{{ 'Country of birth'|trans }} :
{% apply spaceless %} {% if person.countryOfBirth is not null %} {{ person.countryOfBirth.name|localize_translatable_string }} {% else %} {{ 'Unknown country of birth'|trans }} {% endif %} {% endapply %}
{%- endif -%}
{% if person.genderComment.comment is not empty %}

{{ 'Gender comment'|trans }} :

{{ person.genderComment.comment|chill_markdown_to_html }}
{% endif %}
{%- if chill_person.fields.nationality == 'visible' or chill_person.fields.spoken_languages == 'visible'-%}

{{ 'Administrative information'|trans }}

{%- if chill_person.fields.nationality == 'visible' -%}
{{ 'Nationality'|trans }} :
{% if person.nationality is not null %} {{ person.nationality.name|localize_translatable_string }} {% else %} {{ 'Without nationality'|trans }} {% endif %}
{%- endif -%} {%- if chill_person.fields.spoken_languages == 'visible' -%}
{{'Spoken languages'|trans}} :
{% if person.spokenLanguages|length == 0 %} {{ 'Unknown spoken languages'|trans }} {% else %} {% for lang in person.spokenLanguages %} {{ lang.name|localize_translatable_string }}{% if not loop.last %},{% endif %} {% endfor %} {% endif %}
{%- endif -%} {%- if chill_person.fields.number_of_children == 'visible' -%}
{{'Number of children'|trans}} :
{% if person.numberOfChildren is not null %} {{ person.numberOfChildren }} {% else %} {{ 'No data given'|trans }} {% endif %}
{%- endif -%} {%- if chill_person.fields.marital_status == 'visible' -%}
{{'Marital status'|trans}} :
{% if person.maritalStatus is not null %} {{ person.maritalStatus.name|localize_translatable_string }} {% if person.maritalStatusDate is not null %} {{ 'person.from_the'|trans }} {{ person.maritalStatusDate|format_date('long') }} {% endif %} {% else %} {{ 'No data given'|trans }} {% endif %}
{{ 'Comment on the marital status'|trans }} :
{% if person.maritalStatusComment.comment is not empty %}
{{ person.maritalStatusComment.comment|chill_markdown_to_html }}
{% else %} {{ 'No data given'|trans }} {% endif %}
{%- endif -%}
{%- endif -%} {%- if chill_person.fields.email == 'visible' or chill_person.fields.phonenumber == 'visible' or chill_person.fields.mobilenumber == 'visible' or chill_person.fields.contact_info == 'visible' -%}

 {{ 'Contact information'|trans }}

{%- if chill_person.fields.email == 'visible' -%}
{{ 'Email'|trans }} :
{% if person.email is not empty %} {% else %} {{ 'No data given'|trans }} {% endif %}
{%- endif -%} {%- if chill_person.fields.phonenumber == 'visible' -%}
{{ 'Phonenumber'|trans }} :
{% if person.phonenumber is not empty %}
{{ person.phonenumber|chill_format_phonenumber }}
{% else %}{{ 'No data given'|trans }}{% endif %}
{% endif %} {%- if chill_person.fields.mobilenumber == 'visible' -%}
{{ 'Mobilenumber'|trans }} :
{% if person.mobilenumber is not empty %}{{ person.mobilenumber|chill_format_phonenumber }}{% else %}{{ 'No data given'|trans }}{% endif %}

{% if person.acceptSMS %}{{ 'Accept short text message'|trans }}{% endif %}

{% endif %} {%- if chill_person.fields.mobilenumber == 'visible' -%} {% if person.otherPhoneNumbers is not empty %}
{{ 'Others phone numbers'|trans }} :
{% for el in person.otherPhoneNumbers %} {% if el.phonenumber is not empty %}
{% if el.description is not empty %}{{ el.description }} : {% endif %}{{ el.phonenumber|chill_format_phonenumber }}
{% endif %} {% endfor %}
{% endif %} {% endif %} {%- if chill_person.fields.contact_info == 'visible' -%}
{{ 'Notes on contact information'|trans }} :
{% if person.contactInfo is not empty %}
{{ person.contactInfo|chill_markdown_to_html }}
{% else %} {{ 'No data given'|trans }} {% endif %}
{%- endif -%}
{%- endif -%}
{% if cFGroup and (cFGroup.getActiveCustomFields|length > 0) %}
{{ chill_custom_fields_group_widget(person.cFData, cFGroup) }}
{% endif %}
{% if person.createdBy %}
{{ 'Created by'|trans}}: {{ person.createdBy|chill_entity_render_box }},
{{ 'on'|trans ~ person.createdAt|format_datetime('long', 'short') }}
{% endif %} {% if person.updatedBy %} {% import '@ChillPerson/Macro/updatedBy.html.twig' as macro %} {{ macro.updatedBy(person) }} {% endif %}
{% if is_granted('CHILL_PERSON_UPDATE', person) %} {% endif %}
{% endblock %}