{% extends 'creme_core/bricks/base/hat-card.html' %} {% load i18n creme_bricks creme_listview creme_widgets persons_tags %} {% load has_perm_to url from creme_core_tags %} {% block brick_extra_class %}{{block.super}} persons-contact-card-brick{% endblock %} {% block card_intro_content %} {% include 'persons/bricks/frags/card-last-activity.html' %} {% endblock %} {% block card_title %} {{object|persons_pretty_contact}} {% if not object.is_deleted and not object.sandbox %}{% has_perm_to change object as edition_perm %} {% brick_card_action url='persons__edit_contact_names'|url:object.id enabled=edition_perm %} {% endif %} {% endblock %} {% block card_indicators %} {# TODO: factorise with "organisation-hat-card.html" #} {% if is_customer %}
{% translate 'Customer' %}
{% endif %} {% if is_supplier %}
{% translate 'Supplier' %}
{% endif %} {% with neg_label=neglected_indicator.label %} {% if neg_label %}
{{neg_label}}
{% endif %} {% endwith %} {% endblock %} {% block card_secondary %} {% comment %} {% persons_contact_first_employer contact=object user=user as employer %} {% if employer %}
{% if employer.as_manager %}{% translate 'Manager' %}{% else %}{% translate 'Employee' %}{% endif %}, {% widget_entity_hyperlink employer.organisation user %}
{% elif object.position and 'position' not in hidden_fields %}
{{object.position}}
{% endif %} {% endcomment %} {% with total_count=managed_count|add:employers_count %}
{% if total_count >= max_organisations %}
{% url 'persons__list_organisations' as lv_url %} {% if managed_count %} {% blocktranslate count count=managed_count %}Manages {{count}} organisation{% plural %}Manages {{count}} organisations{% endblocktranslate %} {% if employers_count %}, {% blocktranslate count count=employers_count %}employed by {{count}} organisation{% plural %}employed by {{count}} organisations{% endblocktranslate %} {% endif %} {% elif employers_count %} {% blocktranslate count count=employers_count %}Employed by {{count}} organisation{% plural %}Employed by {{count}} organisations{% endblocktranslate %} {% endif %}
{% elif total_count %} {% for orga in managed %}
{% translate 'Manager' %}, {% widget_entity_hyperlink orga user %}
{% endfor %} {% for orga in employers %}
{% translate 'Employee' %}, {% widget_entity_hyperlink orga user %}
{% endfor %} {% elif object.position and 'position' not in hidden_fields %}
{{object.position}}
{% endif %}
{% endwith %} {% endblock %} {% block card_fields_title %} {% translate 'Details' context 'persons-contact' %} {% endblock %} {% block card_fields %} {% if 'phone' not in hidden_fields %}
{% translate 'Phone' %} {{object.phone|default:'—'}} {% brick_card_action_for_field instance=object field='phone' user=user %}
{% endif %} {% if 'mobile' not in hidden_fields %}
{% translate 'Mobile' %} {{object.mobile|default:'—'}} {% brick_card_action_for_field instance=object field='mobile' user=user %}
{% endif %} {% if 'email' not in hidden_fields %}
{% translate 'Email address' %} {% with email=object.email %} {% if email %} {{email}} {% else %} — {% endif %} {% brick_card_action_for_field instance=object field='email' user=user %} {% endwith %}
{% endif %} {% endblock %} {% block card_summary %} {% include 'persons/bricks/frags/card-summary-acts.html' %} {% include 'persons/bricks/frags/card-summary-opportunities.html' %} {% include 'persons/bricks/frags/card-summary-next-activity.html' %} {% endblock %} {% block card_history %} {% include 'persons/bricks/frags/contact-card-history.html' %} {% endblock %}