{# Template to render a thirdparty OPTIONS * display [raw|label|row|bloc] * with_valid_from bool * addAltNames bool * addLink bool * addEntity bool * addInfo bool #} {% macro raw(thirdparty) %} {{ thirdparty.name }} {% endmacro raw %} {% macro label(thirdparty, addLink, addEntity, addInfo, options) %}

{%- if addLink and is_granted('CHILL_3PARTY_3PARTY_SHOW', thirdparty) -%} {{ _self.raw(thirdparty) }} {%- else -%} {{ _self.raw(thirdparty) }} {%- endif -%} {%- if addEntity -%} {{ 'Third party'|trans }} {%- endif -%}

{# AVANT
{{ _self.raw(thirdparty) }}
{% for type in thirdparty.type %} {{ ('chill_3party.key_label.'~type)|trans }} {% endfor %}
{% if thirdparty.comment is not empty %}
{{ thirdparty.comment }}
{% endif %} {% if thirdparty.address %}
{% if thirdparty.address.streetAddress1 %}

{{ thirdparty.address.streetAddress1 }}

{% endif %} {% if thirdparty.address.streetAddress2 is not empty %}

{{ thirdparty.address.streetAddress2 }}

{% endif %} {% if thirdparty.address.postCode is not empty %}

{{ thirdparty.address.postCode.code }} {{ thirdparty.address.postCode.name }}

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

{% endif %}
{%- if options['with_valid_from'] is defined and options['with_valid_from'] == true -%} {{ 'Since %date%'|trans( { '%date%' : thirdparty.address.validFrom|format_date('long') } ) }} {%- endif -%}
{% endif %} {% if thirdparty.email or thirdparty.telephone is not empty %}
{{ thirdparty.telephone|chill_format_phonenumber }}
{% endif %} #} {#- tricks to remove easily whitespace after template -#} {%- if true -%}
{%- endif -%} {% endmacro label %} {%- if display == 'raw' -%} {{ _self.raw(thirdparty) }} {%- endif -%} {%- if display == 'label' -%} {{ _self.label(thirdparty, addLink, addEntity, addInfo, options) }} {%- endif -%} {%- if display == 'row' -%}
{{ _self.label(thirdparty, addLink, addEntity, addInfo, options) }}
{%- endif -%} {%- if display == 'bloc' -%}
{{ _self.label(thirdparty, addLink, addEntity, addInfo, options) }}
{%- endif -%}