{% extends 'creme_core/bricks/base/hat-card.html' %} {% load i18n creme_bricks creme_perms creme_widgets persons_tags %} {% load format_amount from creme_core_tags %} {% block brick_extra_class %}{{block.super}} opportunities-card-brick{% endblock %} {% block card_intro_content %} {# {% include 'persons/bricks/frags/card-last-activity.html' %} #} {% if intro_summary.template_name %}{% include intro_summary.template_name with summary=intro_summary %}{% endif %} {% endblock %} {% block card_title %} {{block.super}} {% if not object.is_deleted and not object.sandbox %} {% brick_card_action_for_field instance=object field='name' user=user %} {% endif %} {% endblock %} {% block card_indicators %} {% if is_neglected %}
{% translate 'No activity since 30 days' %}
{% endif %} {% endblock %} {% block card_secondary %}
{% if target_is_organisation %} {% translate 'Targets the organisation' %} {% widget_entity_hyperlink target user %} {% else %} {% translate 'Targets the contact' %} {% if user|has_perm_to_view:target %} {{target|persons_pretty_contact}}{% persons_contact_first_employer contact=target user=user as employer %} {% if employer %}, {% if employer.as_manager %}{% translate 'manager of the organisation' %}{% else %}{% translate 'employee of the organisation' %}{% endif %} {% widget_entity_hyperlink employer.organisation user %} {% endif %} {% else %} {{HIDDEN_VALUE}} {% endif %} {% endif %}
{% endblock %} {% block card_fields_title %} {% translate 'Details' context 'opportunities' %} {% endblock %} {% block card_fields %}
{% translate 'Sales phase' %} {{object.sales_phase|default:'—'}} {% brick_card_action_for_field instance=object field='sales_phase' user=user %}
{% if 'estimated_sales' not in hidden_fields %}
{% translate 'Estimated sales' %} {% if object.estimated_sales is None %} — {% else %} {{object.estimated_sales|format_amount:object.currency}} {% endif %} {% brick_card_action_for_field instance=object field='estimated_sales' user=user %}
{% endif %} {% if 'made_sales' not in hidden_fields %}
{% translate 'Made sales' %} {% if object.made_sales is None %} — {% else %} {{object.made_sales|format_amount:object.currency}} {% endif %} {% brick_card_action_for_field instance=object field='made_sales' user=user %}
{% endif %} {% endblock %} {% block card_summary %} {% comment %} {% include 'persons/bricks/frags/card-summary-acts.html' %} {% with paginator=contacts.paginator %}
{% if paginator.count == 0 %} {% translate 'Linked contacts' %} {% else %} {% blocktranslate count count=paginator.count %}{{count}} Linked contact{% plural %}{{count}} Linked contacts{% endblocktranslate %} {% endif %} {% for contact in contacts.object_list %}{% widget_join %}{% widget_entity_hyperlink contact user %}{% end_widget_join %}{% empty %}—{% endfor %} {% if paginator.num_pages > 1 %}…{% endif %}
{% endwith %} {% include 'persons/bricks/frags/card-summary-next-activity.html' %} {% endcomment %} {% for summary_ctxt in summaries %} {% if summary_ctxt.template_name %}{% include summary_ctxt.template_name with summary=summary_ctxt %}{% endif %} {% endfor %} {% endblock %}