mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
21 lines
1.2 KiB
Twig
21 lines
1.2 KiB
Twig
{%- macro _render(address, options) -%}
|
|
{%- set options = { 'with_valid_from' : true }|merge(options|default({})) -%}
|
|
{%- set options = { 'has_no_address' : false }|merge(options|default({})) -%}
|
|
<div class="chill_address">
|
|
{% if options['has_no_address'] == true and address.isNoAddress == true %}
|
|
<div class="chill_address_is_noaddress">{{ 'address.consider homeless'|trans }}</div>
|
|
{% endif %}
|
|
<div class="chill_address_address">
|
|
{% if address.streetAddress1 is not empty %}<p class="street street1">{{ address.streetAddress1 }}</p>{% endif %}
|
|
{% if address.streetAddress2 is not empty %}<p class="street street2">{{ address.streetAddress2 }}</p>{% endif %}
|
|
{% if address.postCode is not empty %}
|
|
<p class="postalCode"><span class="code">{{ address.postCode.code }}</span> <span class="name">{{ address.postCode.name }}</span></p>
|
|
<p class="country">{{ address.postCode.country.name|localize_translatable_string }}</p>
|
|
{% endif %}
|
|
</div>
|
|
{%- if options['with_valid_from'] == true -%}
|
|
<span class="address_since">{{ 'Since %date%'|trans( { '%date%' : address.validFrom|format_date('long', 'none') } ) }}</span>
|
|
{%- endif -%}
|
|
</div>
|
|
{%- endmacro -%}
|