{# * 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 "ChillPersonBundle::layout.html.twig" %} {% import 'ChillMainBundle:Address:macro.html.twig' as address %} {% set activeRouteKey = 'chill_person_view' %} {# This view should receive those arguments: - person #} {% block title %}{{ 'Person details'|trans|capitalize ~ ' ' ~ person.firstName|capitalize ~ ' ' ~ person.lastName }}{% 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 personcontent %}
{% if person.memo is not empty and chill_person.fields.memo == 'visible' %}

{{ 'Memo'|trans }}

{{ person.memo|nl2br }}

{% endif %}

{{ 'General information'|trans }}

{{ 'First name'|trans }} :
{{ person.firstName }}
{{ 'Last name'|trans }} :
{{ person.lastName }}
{{ 'Gender'|trans }} :
{{ ( person.gender|default('Not given'))|trans }}
{% if is_granted('CHILL_PERSON_UPDATE', person) %} {{ include(edit_tmp_name, edit_tmp_args) }} {% endif %}

 {{ 'Birth information'|trans }}

{{ 'Date of birth'|trans }} :
{%- if person.birthdate is not null -%} {{ person.birthdate|localizeddate('long', 'none') }} {%- else -%} {{ 'Unknown date of birth'|trans }} {%- endif -%}
{%- if chill_person.fields.place_of_birth == 'visible' -%}
{{ 'Place of birth'|trans }} :
{{ person.placeOfBirth }}
{%- endif -%} {%- if chill_person.fields.country_of_birth == 'visible' -%}
{{ 'Country of birth'|trans }} :
{% spaceless %} {% if person.countryOfBirth is not null %} {{ person.countryOfBirth.name|localize_translatable_string }} {% else %} {{ 'Unknown country of birth'|trans }} {% endif %} {% endspaceless %}
{%- endif -%}
{% if is_granted('CHILL_PERSON_UPDATE', person) %} {{ include(edit_tmp_name, edit_tmp_args) }} {% 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.marital_status == 'visible' -%}
{{'Marital status'|trans}} :
{% if person.maritalStatus is not null %} {{ person.maritalStatus.name|localize_translatable_string }} {% else %} {{ 'No data given'|trans }} {% endif %}
{%- endif -%} {% if is_granted('CHILL_PERSON_UPDATE', person) %} {{ include(edit_tmp_name, edit_tmp_args) }} {% 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.address == 'visible' -%}
{{ 'Address'|trans }}
{%- if person.lastAddress is not empty -%} {{ address._render(person.lastAddress) }} {%- else -%} {{ 'No address given'|trans }} {{ 'Add an address'|trans }} {%- endif -%}
{%- endif -%} {%- if chill_person.fields.email == 'visible' -%}
{{ 'Email'|trans }} :
{% if person.email is not empty %}
{{ person.email|nl2br }}
{% 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 %}
{% endif %} {%- if chill_person.fields.contact_info == 'visible' -%}
{{ 'Notes on contact information'|trans }} :
{% if person.contactInfo is not empty %}{{ person.contactInfo|nl2br }}{% else %}{{ 'No data given'|trans }}{% endif %}
{%- endif -%} {% if is_granted('CHILL_PERSON_UPDATE', person) %} {{ include(edit_tmp_name, edit_tmp_args) }} {% endif %}
{%- endif -%}
{% if cFGroup and (cFGroup.getActiveCustomFields|length > 0) %}
{{ chill_custom_fields_group_widget(person.cFData, cFGroup) }}
{% if is_granted('CHILL_PERSON_UPDATE', person) %} {{ include(edit_tmp_name, edit_tmp_args) }} {% endif %}
{% endif %}
{% endblock %}