{# Template to render an address OPTIONS * render string ['list'|'bloc'|'inline'] * with_valid_from bool start date * with_valid_to bool end date * with_picto bool add a forkawesome pictogram * with_delimiter bool add a delimiter between fragments * has_no_address bool * multiline bool multiline display * extended_infos bool add extra informations (step, floor, etc.) DEPRECATED #} {% macro raw(lines) %} {% for l in lines %}

{{ l }}

{% endfor %} {% endmacro %} {% macro inline(address, options, streetLine, lines) %} {% if options['has_no_address'] == true and address.isNoAddress == true %} {% if address.postCode is not empty %}

{{ address.postCode.code }} {{ address.postCode.name }} {{ address.distribution }}

{{ address.postCode.country.name|localize_translatable_string }}

{% endif %} {% if address.extra is not empty %} {{ address.extra }} {% endif %} {{ 'address.consider homeless'|trans }} {% else %} {{ _self.raw(lines) }} {% endif %} {{ _self.validity(address, options) }} {% endmacro %} {% macro validity(address, options) %} {%- if options['with_valid_from'] == true -%} {{ 'Since %date%'|trans( { '%date%' : address.validFrom|format_date('long') } ) }} {%- endif -%} {%- if options['with_valid_to'] == true -%} {{ 'Until %date%'|trans( { '%date%' : address.validTo|format_date('long') } ) }} {%- endif -%} {% endmacro %} {# this enclose the rendering inside a "li", which ease the placement operation when the address must be shown in such list #} {%- if render == 'list' -%}
  • {% if options['with_picto'] %} {% endif %} {{ _self.inline(address, options, streetLine, lines) }}
  • {%- endif -%} {%- if render == 'inline' -%} {% if options['with_picto'] %} {% endif %} {{ _self.inline(address, options, streetLine, lines) }} {%- endif -%} {%- if render == 'bloc' -%}
    {% if options['has_no_address'] == true and address.isNoAddress == true %} {% if address.postCode is not empty %}

    {{ address.postCode.code }} {{ address.postCode.name }} {{ address.distribution }}

    {{ address.postCode.country.name|localize_translatable_string }}

    {% endif %} {% if address.extra is not empty %}
    {{ address.extra }}
    {% endif %}
    {{ 'address.consider homeless'|trans }}

    {% else %}
    {% if options['with_picto'] %} {% endif %} {{ _self.raw(lines) }}

    {% endif %} {{ _self.validity(address, options) }}
    {%- endif -%}