mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-27 12:36:12 +00:00
167 lines
6.7 KiB
Twig
167 lines
6.7 KiB
Twig
{% extends "@ChillPerson/Person/layout.html.twig" %}
|
|
|
|
{% set activeRouteKey = 'chill_person_view' %}
|
|
|
|
{% block title 'household.Household history for person'|trans %}
|
|
|
|
{% macro bloc_content(p) %}
|
|
<div class="item-row">
|
|
<div class="wrap-header">
|
|
<div class="wh-row">
|
|
<div class="wh-col">
|
|
<h3>
|
|
<i class="fa fa-home"></i>
|
|
<a href="{{ chill_path_add_return_path('chill_person_household_summary',{ 'household_id': p.household.id }) }}">
|
|
{{ 'household.Household number'|trans({'household_num': p.household.id }) }}
|
|
</a>
|
|
</h3>
|
|
</div>
|
|
<div class="wh-col">
|
|
Depuis le {{ p.startDate|format_date('long') }}
|
|
</div>
|
|
</div>
|
|
<div class="wh-row">
|
|
<div class="wh-col"></div>
|
|
{% if p.endDate %}
|
|
<div class="wh-col">
|
|
Jusqu'au {{ p.endDate|format_date('long') }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="item-row separator">
|
|
<div class="wrap-list">
|
|
<div class="wl-row">
|
|
<div class="wl-col title">
|
|
<h3>En tant que</h3>
|
|
</div>
|
|
<div class="wl-col list">
|
|
<p class="item">{{ p.position.label|localize_translatable_string }}
|
|
{% if p.holder %}
|
|
<span class="holder">{{ 'household.holder'|trans }}</span>
|
|
{% endif %}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div class="wl-row">
|
|
<div class="wl-col title">
|
|
<h3>{{ 'household.Members at same time'|trans }}</h3>
|
|
</div>
|
|
<div class="wl-col list">
|
|
{% set simultaneous = p.household.getMembersDuringMembership(p) %}
|
|
{% if simultaneous|length == 0 %}
|
|
<p class="chill-no-data-statement">
|
|
{{ 'household.Any simultaneous members'|trans }}
|
|
</p>
|
|
{% else %}
|
|
{% for m in simultaneous -%}
|
|
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
|
action: 'show', displayBadge: true,
|
|
targetEntity: { name: 'person', id: m.person.id },
|
|
buttonText: m.person|chill_entity_render_string
|
|
} %}
|
|
{%- endfor -%}
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endmacro %}
|
|
|
|
{% block personcontent %}
|
|
<div class="person-household">
|
|
<h1>{{ 'household.Household history'|trans }}</h1>
|
|
|
|
<div class="household_shared">
|
|
<h2 class="chill-blue">{{ 'household.Household shared'|trans }}</h2>
|
|
{% set memberships = person.getHouseholdParticipationsShareHousehold() %}
|
|
|
|
{% if memberships|length == 0 %}
|
|
<p class="chill-no-data-statement">{{ 'household.Never in any household'|trans }}</p>
|
|
|
|
<ul class="record_actions">
|
|
<li>
|
|
<a class="btn btn-misc" href="{{chill_path_add_return_path('chill_person_household_members_editor', { 'persons': [ person.id ]}) }}">
|
|
<i class="fa fa-sign-in fa-fw"></i>
|
|
{{ 'household.Join'|trans }}
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
|
|
{% else %}
|
|
<div class="flex-table">
|
|
{% for p in memberships %}
|
|
<div class="item-bloc">
|
|
|
|
{{ _self.bloc_content(p) }}
|
|
|
|
<div class="item-row separator">
|
|
<ul class="record_actions">
|
|
<li>
|
|
<a href="{{ chill_path_add_return_path('chill_person_household_summary',{ 'household_id': p.household.id }) }}"
|
|
class="btn btn-show" title="{{ 'Show'|trans }}"></a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ chill_path_add_return_path('chill_person_household_member_edit', { id: p.id }) }}"
|
|
class="btn btn-edit" title="{{ 'Edit'|trans }}"></a>
|
|
</li>
|
|
{% if p.isCurrent() %}
|
|
<li>
|
|
<a class="btn btn-misc" href="{{ chill_path_add_return_path( 'chill_person_household_members_editor', { 'persons': [ person.id ], 'allow_leave_without_household': true }) }}">
|
|
<i class="fa fa-scissors"></i>
|
|
{{ 'household.Leave'|trans }}
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
</ul>
|
|
</div>
|
|
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
{% if not person.isSharingHousehold() %}
|
|
<ul class="record_actions">
|
|
<li>
|
|
<a class="btn btn-misc" href="{{ chill_path_add_return_path('chill_person_household_members_editor', { 'persons': [ person.id ]}) }}">
|
|
<i class="fa fa-sign-in fa-fw"></i>
|
|
{{ 'household.Join'|trans }}
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
<div class="household_not_shared">
|
|
{% set memberships = person.getHouseholdParticipationsNotShareHousehold() %}
|
|
{% if memberships|length > 0 %}
|
|
|
|
<h2 class="chill-blue">{{ 'household.Household not shared'|trans }}</h2>
|
|
|
|
<div class="flex-table">
|
|
{% for p in memberships %}
|
|
<div class="item-bloc">
|
|
|
|
{{ _self.bloc_content(p) }}
|
|
|
|
<div class="item-row separator">
|
|
<ul class="record_actions">
|
|
<li>
|
|
<a href="{{ chill_path_add_return_path('chill_person_household_member_edit', { id: p.id }) }}"
|
|
class="btn btn-edit" title="{{ 'Edit'|trans }}"></a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
</div>
|
|
{% endblock %}
|