mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
render box address, remove macro address, refactoring (wip)
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
{% extends '@ChillPerson/AccompanyingCourse/layout.html.twig' %}
|
||||
|
||||
{% import '@ChillMain/Address/macro.html.twig' as address %}
|
||||
|
||||
{% block title %}
|
||||
{{ 'Resume Accompanying Course'|trans }}
|
||||
{% endblock %}
|
||||
|
@@ -16,110 +16,94 @@
|
||||
#}
|
||||
{% extends "@ChillPerson/Person/layout.html.twig" %}
|
||||
|
||||
{% import '@ChillMain/Address/macro.html.twig' as address_macros %}
|
||||
|
||||
{% set activeRouteKey = '' %}
|
||||
|
||||
{% block title %}{{ 'Addresses history for %name%'|trans({ '%name%': person.firstName ~ ' ' ~ person.lastName } ) }}{% endblock %}
|
||||
|
||||
{% block personcontent %}
|
||||
<div class="person-addresses">
|
||||
|
||||
<h1>{{ 'Addresses history'|trans }}</h1>
|
||||
|
||||
<div class="address-timeline grid">
|
||||
|
||||
{% if person.addresses|length == 0 %}
|
||||
<span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
|
||||
{% else %}
|
||||
<div class="top"><i class="fa fa-caret-up fa-3x"></i></div>
|
||||
{% endif %}
|
||||
|
||||
{% for address in person.addresses %}
|
||||
|
||||
{# if person address #}
|
||||
<div class="col-a content{{ ' row' ~ loop.index }}">
|
||||
<div class="address">
|
||||
{% if address.isNoAddress == true %}
|
||||
<div class="chill_address_is_noaddress">{{ 'address.consider homeless'|trans }}</div>
|
||||
{% else %}
|
||||
|
||||
{% if address.street is not empty %}
|
||||
<div class="street">
|
||||
<span class="streetNumber">{{ address.street }}</span>
|
||||
{% if address.streetNumber is not empty %}
|
||||
<span class="streetNumber">, {{ address.streetNumber }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if address.postCode is not empty %}
|
||||
<div class="postCode">
|
||||
<span>{{ address.postCode.code }}</span> <span>{{ address.postCode.name }}</span>
|
||||
<span class="country">({{ address.postCode.country.name|localize_translatable_string }})</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ path('chill_person_address_edit', { 'person_id': person.id, 'address_id' : address.id } ) }}" class="btn btn-edit"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{# endif #}
|
||||
|
||||
<div class="col-b"></div>
|
||||
|
||||
{# if household address #}{#
|
||||
<div class="col-c content rowXX">
|
||||
<div class="address">...</div>
|
||||
</div>
|
||||
#}{# endif #}
|
||||
|
||||
<div class="date">
|
||||
{% if address.validFrom is not empty %}
|
||||
{{ address.validFrom|format_date('long') }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{# TEST HOUSEHOLD POSITION
|
||||
#}
|
||||
<div class="col-b"></div>
|
||||
<div class="col-c content fake">
|
||||
<div class="address">
|
||||
<div class="street">
|
||||
<span class="streetNumber">549, chemin De Sousa</span>
|
||||
<span class="streetNumber">, 45, boulevard Aurore Roux</span>
|
||||
</div>
|
||||
<div class="postCode">
|
||||
<span>10850</span> <span>Nanterre</span> <span class="country">(France)</span>
|
||||
</div>
|
||||
<ul class="record_actions"><li><a href="" class="btn btn-edit"></a></li></ul>
|
||||
</div>
|
||||
|
||||
<h1>{{ 'Addresses history'|trans }}</h1>
|
||||
|
||||
<div class="address-timeline grid">
|
||||
|
||||
{% if person.addresses|length == 0 %}
|
||||
<span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
|
||||
{% else %}
|
||||
<div class="top"><i class="fa fa-caret-up fa-3x"></i></div>
|
||||
{% endif %}
|
||||
|
||||
{% for address in person.addresses %}
|
||||
|
||||
{# if person address #}
|
||||
<div class="col-a content{{ ' row' ~ loop.index }}">
|
||||
<div class="address">
|
||||
{% if address.isNoAddress == true %}
|
||||
<div class="chill_address_is_noaddress">{{ 'address.consider homeless'|trans }}</div>
|
||||
{% else %}
|
||||
{{ address|chill_entity_render_box({
|
||||
'multiline': false, 'with_valid_from': false
|
||||
}) }}
|
||||
{% endif %}
|
||||
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ path('chill_person_address_edit', { 'person_id': person.id, 'address_id' : address.id } ) }}" class="btn btn-edit"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="date">01 janvier 1970</div>
|
||||
{# END TEST #}
|
||||
|
||||
</div>
|
||||
{# endif #}
|
||||
|
||||
<div class="col-b"></div>
|
||||
|
||||
{# if household address #}{#
|
||||
<div class="col-c content rowXX">
|
||||
<div class="address">...</div>
|
||||
</div>
|
||||
#}{# endif #}
|
||||
|
||||
<div class="date">
|
||||
{% if address.validFrom is not empty %}
|
||||
{{ address.validFrom|format_date('long') }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
<li class="cancel">
|
||||
<a href="{{ path('chill_person_view', { 'person_id' : person.id } ) }}" class="btn btn-cancel">
|
||||
{{ 'Back to the person details'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-create"
|
||||
href="{{ path('chill_person_address_new', { 'person_id' : person.id } ) }}">
|
||||
{{ 'Add an address'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{# TEST HOUSEHOLD POSITION
|
||||
#}
|
||||
<div class="col-b"></div>
|
||||
<div class="col-c content fake">
|
||||
<div class="address">
|
||||
<div class="street">
|
||||
<span class="streetNumber">549, chemin De Sousa</span>
|
||||
<span class="streetNumber">, 45, boulevard Aurore Roux</span>
|
||||
</div>
|
||||
<div class="postCode">
|
||||
<span>10850</span> <span>Nanterre</span> <span class="country">(France)</span>
|
||||
</div>
|
||||
<ul class="record_actions"><li><a href="" class="btn btn-edit"></a></li></ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="date">01 janvier 1970</div>
|
||||
{# END TEST #}
|
||||
|
||||
</div>
|
||||
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
<li class="cancel">
|
||||
<a href="{{ path('chill_person_view', { 'person_id' : person.id } ) }}" class="btn btn-cancel">
|
||||
{{ 'Back to the person details'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-create"
|
||||
href="{{ path('chill_person_address_new', { 'person_id' : person.id } ) }}">
|
||||
{{ 'Add an address'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@@ -16,8 +16,6 @@
|
||||
#}
|
||||
{% extends "@ChillPerson/Person/layout.html.twig" %}
|
||||
|
||||
{% import '@ChillMain/Address/macro.html.twig' as address %}
|
||||
|
||||
{% set activeRouteKey = 'chill_person_view' %}
|
||||
|
||||
{#
|
||||
@@ -171,7 +169,7 @@ This view should receive those arguments:
|
||||
<dt>{{ 'Address'|trans }}</dt>
|
||||
<dd>
|
||||
{%- if person.lastAddress is not empty -%}
|
||||
{{ address._render(person.lastAddress, {'has_no_address': true}) }}
|
||||
{{ person.lastAddress|chill_entity_render_box({'has_no_address': true}) }}
|
||||
|
||||
<ul class="list-inline text-right mt-2">
|
||||
<li class="list-inline-item">
|
||||
|
@@ -1,7 +1,5 @@
|
||||
{%- macro details(person, options) -%}
|
||||
|
||||
{% import '@ChillMain/Address/macro.html.twig' as address %}
|
||||
|
||||
<ul>
|
||||
<li><b>{{ 'gender'|trans }}</b>:
|
||||
{{ person.gender|trans }}</li>
|
||||
@@ -24,7 +22,9 @@
|
||||
<li><b>{{ 'memo'|trans }}</b>:
|
||||
{{ person.memo }}</li>
|
||||
<li><b>{{ 'address'|trans }}</b>:
|
||||
{%- if person.lastAddress is not empty -%}{{ address._render(person.lastAddress, {'with_valid_from': false}) }}{% endif %}</li>
|
||||
{%- if person.lastAddress is not empty -%}
|
||||
{{ person.lastAddress|chill_entity_render_box({'with_valid_from': false}) }}
|
||||
{% endif %}</li>
|
||||
<li><b>{{ 'spokenLanguages'|trans }}</b>:
|
||||
{% for lang in person.spokenLanguages %}{{ lang.name|localize_translatable_string }}{% if not loop.last %},{% endif %}{% endfor %}</li>
|
||||
<li><b>{{ 'contactInfo'|trans }}</b>:
|
||||
@@ -43,4 +43,4 @@
|
||||
<li><b>{{ person.counters.nb_addresses }}</b> {{ (person.counters.nb_addresses > 1)? 'adresses' : 'adresse' }}</li>
|
||||
|
||||
</ul>
|
||||
{% endmacro %}
|
||||
{% endmacro %}
|
||||
|
Reference in New Issue
Block a user