display person and thirdparty informations in accompanyingCourse index template (twig)

This commit is contained in:
Mathieu Jaumotte 2021-05-24 11:23:03 +02:00
parent d4f96ee25f
commit cdade50d76

View File

@ -1,4 +1,5 @@
{% extends 'ChillPersonBundle:AccompanyingCourse:layout.html.twig' %}
{% import '@ChillMain/Address/macro.html.twig' as address %}
{% block title %}
{{ 'Resume Accompanying Course'|trans }}
@ -6,23 +7,113 @@
{% block content %}
{% if 'DRAFT' == accompanyingCourse.step %}
<div class="grid-8 centered error flash_message">
<span>
{{ 'This accompanying course is still a draft'|trans }}
<a href="{{ path('chill_person_accompanying_course_show', { 'accompanying_period_id': accompanyingCourse.id } ) }}">
{{ 'Edit & activate accompanying course'|trans }}
</a>
</span>
</div>
{% endif %}
{% if 'DRAFT' == accompanyingCourse.step %}
<div class="grid-8 centered error flash_message">
<span>
{{ 'This accompanying course is still a draft'|trans }}
<a href="{{ path('chill_person_accompanying_course_show', { 'accompanying_period_id': accompanyingCourse.id } ) }}">
{{ 'Edit & activate accompanying course'|trans }}
</a>
</span>
</div>
{% endif %}
<h1>{{ 'Associated peoples'|trans }}</h1>
<h2>{{ 'Associated peoples'|trans }}</h2>
<h1>{{ 'Resources'|trans }}</h1>
{% for p in accompanyingCourse.participations %}
{% if p.enddate is null %}
<h5>
{{ p.person.firstname ~ ' ' ~ p.person.lastname }}
</h5>
{{ p.person.gender == 'woman' ? 'F' : 'M' }}<br>
{{ 'né le ' ~ p.person.birthdate|format_date('short') }}<br>
<h1>{{ 'Social actions'|trans }}</h1>
<h1>{{ 'Last events on accompanying course'|trans }}</h1>
{% if p.person.mobilenumber %}
<i class="fa fa-fw fa-mobile"></i>{{ p.person.mobilenumber }}
{% else %}
<i class="fa fa-fw fa-phone"></i>
{% if p.person.phonenumber %}
{{ p.person.phonenumber }}
{% else %}
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
{% endif %}
{% endif %}<br>
{%- if p.person.lastAddress is not empty -%}
{{ address._render(p.person.lastAddress, {'has_no_address': true, 'with_valid_from': false, 'with_icon': true}) }}
{%- else -%}
<i class="fa fa-fw fa-map-marker"></i>
<span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
{%- endif -%}
<ul class="record_actions">
<li>
<a href="{{ path('chill_person_view', { person_id: p.person.id }) }}" class="sc-button bt-show" target="_blank" title="Voir"></a>
</li>
</ul>
{% endif %}
{% endfor %}
<h2>{{ 'Resources'|trans }}</h2>
{% for r in accompanyingCourse.resources %}
{% if r.person %}
<h5>
{{ r.person.firstname ~ ' ' ~ r.person.lastname }}
<span class="badge badge-pill badge-secondary">{{ 'Usager' }}</span>
</h5>
{{ r.person.gender == 'woman' ? 'F' : 'M' }}<br>
{{ 'né le ' ~ r.person.birthdate|format_date('short') }}<br>
{% if r.person.mobilenumber %}
<i class="fa fa-fw fa-mobile"></i>{{ r.person.mobilenumber }}
{% else %}
<i class="fa fa-fw fa-phone"></i>
{% if r.person.phonenumber %}
{{ r.person.phonenumber }}
{% else %}
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
{% endif %}
{% endif %}<br>
{%- if r.person.lastAddress is not empty -%}
{{ address._render(r.person.lastAddress, {'has_no_address': true, 'with_valid_from': false, 'with_icon': true}) }}
{%- else -%}
<i class="fa fa-fw fa-map-marker"></i>
<span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
{%- endif -%}
<ul class="record_actions">
<li>
<a href="{{ path('chill_person_view', { person_id: r.person.id }) }}" class="sc-button bt-show" target="_blank" title="Voir"></a>
</li>
</ul>
{% endif %}
{% if r.thirdParty %}
<h5>
{{ r.thirdParty.name }}
<span class="badge badge-pill badge-secondary">{{ 'Tiers' }}</span>
</h5>
<i class="fa fa-fw fa-phone"></i>{{ r.thirdParty.telephone|chill_print_or_message("thirdparty.No_phonenumber") }}<br>
<i class="fa fa-fw fa-envelope-o"></i>{{ r.thirdParty.email|chill_print_or_message("thirdparty.No_email") }}<br>
{% if r.thirdParty.address == null %}
<i class="fa fa-fw fa-map-marker"></i><span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
{% else %}
{{ address._render(r.thirdParty.address, {'with_valid_from': false, 'with_icon': true }) }}
{% endif %}
<ul class="record_actions">
<li>
<a href="{{ path('chill_3party_3party_show', { thirdparty_id: r.thirdParty.id }) }}" class="sc-button bt-show" target="_blank" title="Voir"></a>
</li>
</ul>
{% endif %}
{% endfor %}
<h2>{{ 'Social actions'|trans }}</h2>
<h2>{{ 'Last events on accompanying course'|trans }}</h2>
{% endblock %}