{% extends "base.html" %} {% from "_macros.html" import order_badge with context %} {% block title %}{{ ld.title if ld else t('New Opportunity') }}{% endblock %} {% block content %} {% set editable = can_write %}
{{ t('CRM Pipeline') }}{% if ld %} · {{ ld.number }}{% endif %}

{{ ld.title if ld else t('New Opportunity') }} {% if ld %}{{ t(ld.stage|capitalize) }}{% endif %}

{% if ld and ld.stage == 'lost' and ld.lost_reason %}{{ t('Lost reason') }}: {{ ld.lost_reason }}{% endif %}
{% if ld and can_write %}
{% for o in orders %}{{ o.number }} {{ order_badge(o.state, 'sale') }}{% endfor %} {% if has('sales') and ld.stage not in ('won', 'lost') %}
{% endif %} {% if ld.stage != 'won' %}
{% endif %} {% if ld.stage != 'lost' %}
{% endif %} {% if ld.stage in ('won', 'lost') %}
{% endif %}
{% endif %}
{% if ld %}
{% for key, label, prob in stages if key != 'lost' %}
{% endfor %}
{% endif %}
{% if editable %}
{{ t('Cancel') }}
{% endif %}
{% if ld %}

{{ t('Activities') }}

{% for a in activities %} {% else %}{% endfor %}
{{ t(dict(kinds)[a.kind]) }} {% if a.done %}{{ a.summary }}{% else %}{{ a.summary }}{% endif %}{% if a.notes %}
{{ a.notes }}{% endif %}
{{ a.full_name or a.username or '' }} {% if a.due_date %}{{ a.due_date }}{% endif %} {% if not a.done and can_write %}
{% elif a.done %}{{ t('Done') }}{% endif %}
{{ t('Nothing yet.') }}
{% if can_write %}
{% endif %}
{% endif %} {% endblock %}