{% extends 'creme_core/bricks/base/hat-card.html' %} {% load i18n creme_bricks creme_listview persons_tags %} {% load has_perm_to url url_join from creme_core_tags %} {% block brick_extra_class %}{{block.super}} persons-organisation-card-brick{% endblock %} {% block card_intro_content %} {% include 'persons/bricks/frags/card-last-activity.html' %} {% endblock %} {% block card_main %}
{{object.name}}{% if object.legal_form and 'legal_form' not in hidden_fields %}, {{object.legal_form}}{% endif %} {% if not object.is_deleted and not object.sandbox %} {% brick_card_action_for_field instance=object field='name' user=user %} {% endif %} {% include 'creme_core/bricks/frags/hat-card-title-indicators.html' %}
{% if object.is_managed %}
{% blocktranslate with software=SOFTWARE_LABEL %}Managed by {{software}}{% endblocktranslate %}
{% endif %} {% if is_customer %}
{% translate 'Customer' %}
{% endif %} {% if is_supplier %}
{% translate 'Supplier' %}
{% endif %}
{% endblock %} {% block card_secondary %} {# {% with managers_count=managers|length employees_count=employees|length %} #} {% with total_count=managers_count|add:employees_count %} {#
#}
{# {% if total_count >= 15 %} #} {% if total_count >= max_contacts %} {% url 'persons__list_contacts' as lv_url %} {% if managers_count %}{% blocktranslate count count=managers_count %}{{count}} Manager{% plural %}{{count}} Managers{% endblocktranslate %}{% endif %} {% if managers_count and employees_count %}, {% endif %} {% if employees_count %}{% blocktranslate count count=employees_count %}{{count}} Employee{% plural %}{{count}} Employees{% endblocktranslate %}{% endif %} {% elif position_is_hidden %} {% for manager in managers %} {% translate 'Manager' %} {{manager|persons_pretty_contact}}{% if not forloop.last or employees %}, {% endif %} {% endfor %} {% for employee in employees %} {% translate 'Employee' %} {{employee|persons_pretty_contact}}{% if not forloop.last %}, {% endif %} {% endfor %} {% else %} {% for manager in managers %} {{manager.position|default:_('Manager')}} {{manager|persons_pretty_contact}}{% if not forloop.last or employees %}, {% endif %} {% endfor %} {% for employee in employees %} {{employee.position|default:_('Employee')}} {{employee|persons_pretty_contact}}{% if not forloop.last %}, {% endif %} {% endfor %} {% endif %}
{# {% endwith %} #} {% endwith %} {% endblock %} {% block card_fields_title %} {% translate 'Details' context 'persons-organisation' %} {% endblock %} {% block card_fields %}{% has_perm_to change object as edition_perm %} {% if 'phone' not in hidden_fields %}
{% translate 'Phone' %} {{object.phone|default:'—'}} {% brick_card_action_for_field instance=object field='phone' user=user %}
{% endif %} {% if 'billing_address' not in hidden_fields %}
{% translate 'Address' %} {% with address=object.billing_address %} {% if address is not None %} {% with address_desc=address|persons_pretty_address|linebreaksbr %} {% if address_desc %}{{address_desc}}{% else %}—{% endif %} {% url_join address.get_edit_absolute_url type='billing' as b_uri %}{% brick_card_action url=b_uri enabled=edition_perm %} {% endwith %} {% else %} — {% brick_card_action url='persons__create_billing_address'|url:object.id enabled=edition_perm %} {% endif %} {% 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 %}