{% load i18n creme_perms mobile_tags %}{% load bool or_op from creme_core_tags %} {% if user|has_perm_to_view:contact %} {% mobile_prepare_fields contact 'email' 'billing_address' 'position' 'phone' 'mobile' %} {% with email=contact.email address=contact.billing_address position=contact.position organisations=contact.get_employers %} {% with has_address=address|bool %} {% with more_info=email|or_op:has_address|or_op:position|or_op:organisations %}
{% translate 'contact' %} {% if more_info %} {{contact.first_name}} {{contact.last_name}} {% else %} {{contact.first_name}} {{contact.last_name}} {% endif %}
{% with phone=contact.phone mobile=contact.mobile %} {% if phone %}
{% translate 'phone' %} {{phone}}
{% endif %} {% if mobile %}
{% translate 'mobile' %} {{mobile}}
{% endif %} {% endwith %} {% if more_info %}
{% if email %}
{% translate 'email' %} {{email}}
{% endif %} {% if has_address %} {% endif %} {% if position %}
{% translate 'position' %} {{position}}
{% endif %} {% for orga in organisations %} {% mobile_prepare_fields orga 'phone' 'billing_address' %} {% with orga_phone=orga.phone orga_address=orga.billing_address %} {% with orga_has_address=orga_address|bool %} {% if orga_phone or orga_has_address %}
{% translate 'organisation' %} {{orga}}
{% if orga_phone %}
{% translate 'phone' %} {{orga_phone}}
{% endif %} {% if orga_has_address %}
{% translate 'address' %} {{orga_address|linebreaksbr}}
{% endif %}
{% else %}
{% translate 'organisation' %} {{orga}}
{% endif %} {% endwith %}{% endwith %} {% endfor %}
{% endif %}
{% endwith %}{% endwith %}{% endwith %} {% else %}
{% translate 'contact' %} ?? ??
{% endif %}