mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-22 02:04:24 +00:00
303 lines
13 KiB
Twig
303 lines
13 KiB
Twig
{#
|
|
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
|
|
*
|
|
* 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 <http://www.gnu.org/licenses/>.
|
|
#}
|
|
{% 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.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 %}
|
|
<div class="person-view">
|
|
|
|
<div class="row">
|
|
{% if person.memo is not empty and chill_person.fields.memo == 'visible' %}
|
|
<div class="col-12">
|
|
<figure class="person-details">
|
|
<h2 class="chill-red">{{ 'Memo'|trans }}</h2>
|
|
<div class="chill-user-quote">
|
|
{{ person.memo|chill_markdown_to_html }}
|
|
</div>
|
|
</figure>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="col-sm-6 my-3">
|
|
<figure class="person-details">
|
|
<h2 class="chill-red">{{ 'General information'|trans }}</h2>
|
|
<dl>
|
|
<dt>{{ 'First name'|trans }} :</dt>
|
|
<dd>{{ person.firstName }}</dd>
|
|
|
|
<dt>{{ 'Last name'|trans }} :</dt>
|
|
<dd>{{ person.lastName }}</dd>
|
|
{% for el in person.altNames %}
|
|
{% if el.key in alt_names|keys %}
|
|
<dt>{{ alt_names[el.key]|localize_translatable_string }} :</dt>
|
|
<dd>{{ el.label }}</dd>
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
<dt>{{ 'Gender'|trans }} :</dt>
|
|
<dd>{{ ( person.gender|default('Not given'))|trans }}</dd>
|
|
|
|
</dl>
|
|
</figure>
|
|
</div>
|
|
|
|
<div class="col-sm-6 my-3">
|
|
<figure class="person-details">
|
|
<h2 class="chill-green"><i class="fa fa-birthday-cake"></i> {{ 'Birth information'|trans }}</h2>
|
|
<dl>
|
|
<dt>{{ 'Date of birth'|trans }} :</dt>
|
|
<dd>
|
|
{%- if person.birthdate is not null -%}
|
|
{{ person.birthdate|format_date('long') }}
|
|
{%- else -%}
|
|
<span class="chill-no-data-statement">{{ 'Unknown date of birth'|trans }}</span>
|
|
{%- endif -%}
|
|
</dd>
|
|
|
|
{%- if chill_person.fields.place_of_birth == 'visible' -%}
|
|
<dt>{{ 'Place of birth'|trans }} :</dt>
|
|
{% if person.placeOfBirth is not empty %}
|
|
<dd>{{ person.placeOfBirth }}</dd>
|
|
{% else %}
|
|
<dd><span class="chill-no-data-statement">{{ 'Not given'|trans }}</span></dd>
|
|
{% endif %}
|
|
{%- endif -%}
|
|
|
|
{%- if chill_person.fields.country_of_birth == 'visible' -%}
|
|
<dt>{{ 'Country of birth'|trans }} :</dt>
|
|
<dd>{% apply spaceless %}
|
|
{% if person.countryOfBirth is not null %}
|
|
{{ person.countryOfBirth.name|localize_translatable_string }}
|
|
{% else %}
|
|
<span class="chill-no-data-statement">{{ 'Unknown country of birth'|trans }}</span>
|
|
{% endif %}
|
|
{% endapply %}</dd>
|
|
{%- endif -%}
|
|
</dl>
|
|
</figure>
|
|
</div>
|
|
|
|
{% if person.genderComment.comment is not empty %}
|
|
<div class="col-12">
|
|
<figure class="person-details">
|
|
<h2 class="chill-beige">{{ 'Gender comment'|trans }} :</h2>
|
|
<div class="chill-user-quote">
|
|
{{ person.genderComment.comment|chill_markdown_to_html }}
|
|
</div>
|
|
</figure>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="row">
|
|
{%- if chill_person.fields.nationality == 'visible' or chill_person.fields.spoken_languages == 'visible'-%}
|
|
<div class="col-sm-6 my-3">
|
|
<figure class="person-details">
|
|
<h2 class="chill-orange">{{ 'Administrative information'|trans }}</h2>
|
|
|
|
{%- if chill_person.fields.nationality == 'visible' -%}
|
|
<dl>
|
|
<dt>{{ 'Nationality'|trans }} :</dt>
|
|
<dd>
|
|
{% if person.nationality is not null %}
|
|
{{ person.nationality.name|localize_translatable_string }}
|
|
{% else %}
|
|
<span class="chill-no-data-statement">{{ 'Without nationality'|trans }}</span>
|
|
{% endif %}
|
|
</dd>
|
|
</dl>
|
|
{%- endif -%}
|
|
{%- if chill_person.fields.spoken_languages == 'visible' -%}
|
|
<dl>
|
|
<dt>{{'Spoken languages'|trans}} :</dt>
|
|
<dd>
|
|
{% if person.spokenLanguages|length == 0 %}
|
|
<span class="chill-no-data-statement">{{ 'Unknown spoken languages'|trans }}</span>
|
|
{% else %}
|
|
{% for lang in person.spokenLanguages %}
|
|
{{ lang.name|localize_translatable_string }}{% if not loop.last %},{% endif %}
|
|
{% endfor %}
|
|
{% endif %}
|
|
</dd>
|
|
</dl>
|
|
{%- endif -%}
|
|
{%- if chill_person.fields.marital_status == 'visible' -%}
|
|
<dl>
|
|
<dt>{{'Marital status'|trans}} :</dt>
|
|
<dd>
|
|
{% if person.maritalStatus is not null %}
|
|
{{ person.maritalStatus.name|localize_translatable_string }}
|
|
{% else %}
|
|
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
|
|
{% endif %}
|
|
</dd>
|
|
|
|
<dt>{{ 'Comment on the marital status'|trans }} :</dt>
|
|
<dd>
|
|
{% if person.maritalStatusComment.comment is not empty %}
|
|
<blockquote class="chill-user-quote">
|
|
{{ person.maritalStatusComment.comment|chill_markdown_to_html }}
|
|
</blockquote>
|
|
{% else %}
|
|
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
|
|
{% endif %}
|
|
</dd>
|
|
</dl>
|
|
{%- endif -%}
|
|
</figure>
|
|
</div>
|
|
{%- 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' -%}
|
|
<div class="col-sm-6 my-3">
|
|
<figure class="person-details">
|
|
<h2 class="chill-blue"><i class="fa fa-envelope-o"></i> {{ 'Contact information'|trans }}</h2>
|
|
|
|
{%- if chill_person.fields.address == 'visible' -%}
|
|
<dl>
|
|
<dt>{{ 'Address'|trans }}</dt>
|
|
<dd>
|
|
{%- if person.lastAddress is not empty -%}
|
|
{{ person.lastAddress|chill_entity_render_box({
|
|
'render': 'bloc',
|
|
'multiline': true,
|
|
'extended_infos': true,
|
|
'has_no_address': true
|
|
}) }}
|
|
|
|
<ul class="list-inline text-right mt-2">
|
|
<li class="list-inline-item">
|
|
<a class="btn btn-warning btn-sm" title="{{ 'Edit'|trans }}"
|
|
href="{{ path('chill_person_address_edit', { 'person_id': person.id, 'address_id' : person.lastAddress.id } ) }}">
|
|
<i class="fa fa-pencil fa-fw"></i>
|
|
</a>
|
|
</li>
|
|
<li class="list-inline-item">
|
|
<a class="btn btn-secondary btn-sm" title="{{ "Addresses history"|trans }}"
|
|
href="{{ path('chill_person_address_list', { 'person_id': person.id } ) }}">
|
|
<i class="fa fa-list fa-fw"></i>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
|
|
{%- else -%}
|
|
<span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
|
|
<a href="{{ path('chill_person_address_new', { 'person_id' : person.id } ) }}" class="">
|
|
{{ 'Add an address'|trans }}
|
|
</a>
|
|
{%- endif -%}
|
|
</dd>
|
|
</dl>
|
|
{%- endif -%}
|
|
|
|
{%- if chill_person.fields.email == 'visible' -%}
|
|
<dl>
|
|
<dt>{{ 'Email'|trans }} :</dt>
|
|
<dd>{% if person.email is not empty %}
|
|
<a href="{{ 'mailto:' ~ person.email }}" class="email">{{ person.email|nl2br }}</a>
|
|
{% else %}
|
|
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
|
|
{% endif %}
|
|
</dd>
|
|
</dl>
|
|
{%- endif -%}
|
|
|
|
{%- if chill_person.fields.phonenumber == 'visible' -%}
|
|
<dl>
|
|
<dt>{{ 'Phonenumber'|trans }} :</dt>
|
|
<dd>{% if person.phonenumber is not empty %}<a href="tel:{{ person.phonenumber }}"><pre>{{ person.phonenumber|chill_format_phonenumber }}</pre></a>{% else %}<span class="chill-no-data-statement">{{ 'No data given'|trans }}{% endif %}</dd>
|
|
</dl>
|
|
{% endif %}
|
|
|
|
{%- if chill_person.fields.mobilenumber == 'visible' -%}
|
|
<dl>
|
|
<dt>{{ 'Mobilenumber'|trans }} :</dt>
|
|
<dd>{% if person.mobilenumber is not empty %}<a href="tel:{{ person.mobilenumber }}"><pre>{{ person.mobilenumber|chill_format_phonenumber }}</pre></a>{% else %}<span class="chill-no-data-statement">{{ 'No data given'|trans }}{% endif %}</dd>
|
|
</dl>
|
|
{% endif %}
|
|
|
|
{# TODO
|
|
display collection of others phonenumbers
|
|
#}
|
|
|
|
{%- if chill_person.fields.contact_info == 'visible' -%}
|
|
<dl>
|
|
<dt>{{ 'Notes on contact information'|trans }} :</dt>
|
|
<dd>
|
|
{% if person.contactInfo is not empty %}
|
|
<blockquote class="chill-user-quote">
|
|
{{ person.contactInfo|chill_markdown_to_html }}
|
|
</blockquote>
|
|
{% else %}
|
|
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
|
|
{% endif %}
|
|
</dd>
|
|
</dl>
|
|
{%- endif -%}
|
|
|
|
</figure>
|
|
</div>
|
|
{%- endif -%}
|
|
|
|
</div>
|
|
|
|
{% if cFGroup and (cFGroup.getActiveCustomFields|length > 0) %}
|
|
<div class="row">
|
|
<div class="col-12 custom-fields">
|
|
<figure class="person-details">
|
|
{{ chill_custom_fields_group_widget(person.cFData, cFGroup) }}
|
|
</figure>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<figure class="person-details"></figure>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
|
|
<ul class="sticky-form-buttons record_actions">
|
|
<li>
|
|
<a class="btn btn-update" href="{{ path('chill_person_general_edit', { 'person_id': person.id }) }}">
|
|
{{ 'Edit'|trans }}
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
{% endif %}
|
|
|
|
</div>
|
|
{% endblock %}
|