{% extends "base.html" %} {% from "components/ui.html" import page_header, breadcrumb_nav %} {% block title %}{{ lead.full_name }} - {{ config.APP_NAME }}{% endblock %} {% block content %} {% set breadcrumbs = [ {'text': _('Leads'), 'url': url_for('leads.list_leads')}, {'text': lead.full_name} ] %} {% set actions_html %}
{{ _('Edit') }} {{ _('Add Activity') }} {% if not lead.is_converted and not lead.is_lost %} {{ _('Convert to Client') }} {{ _('Convert to Deal') }}
{% endif %}
{% endset %} {{ page_header( icon_class='fas fa-user-plus', title_text=lead.full_name, subtitle_text=lead.company_name or lead.title or _('Lead'), breadcrumbs=breadcrumbs, actions_html=actions_html ) }}

{{ _('Contact Information') }}

{% if lead.company_name %}

{{ _('Company') }}

{{ lead.company_name }}

{% endif %} {% if lead.email %}

{{ _('Email') }}

{{ lead.email }}

{% endif %} {% if lead.phone %}

{{ _('Phone') }}

{{ lead.phone }}

{% endif %} {% if lead.title %}

{{ _('Title') }}

{{ lead.title }}

{% endif %} {% if lead.source %}

{{ _('Source') }}

{{ lead.source }}

{% endif %} {% if not lead.company_name and not lead.email and not lead.phone and not lead.title and not lead.source %}

{{ _('No contact details yet') }}

{% endif %}

{{ _('Lead Details') }}

{{ _('Status') }}

{{ lead.status|title }}

{{ _('Score') }}

{{ lead.score or 0 }}

{% if lead.estimated_value is not none and lead.estimated_value %}

{{ _('Estimated Value') }}

{{ "%.2f"|format(lead.estimated_value) }} {{ lead.currency_code }}

{% endif %} {% if lead.owner %}

{{ _('Owner') }}

{{ lead.owner.display_name if lead.owner.display_name else lead.owner.email }}

{% endif %}

{{ _('Created') }}

{{ lead.created_at|user_datetime if lead.created_at else '—' }}

{% if lead.notes %}

{{ _('Notes') }}

{{ lead.notes }}

{% endif %} {% if lead.tags %}

{{ _('Tags') }}

{% for tag in lead.tags.split(',') if tag.strip() %} {{ tag.strip() }} {% endfor %}
{% endif %}

{{ _('Activity') }}

{{ _('Add Activity') }}
{% if activities %}
{% for activity in activities %}

{{ activity.subject or activity.type|title }}

{{ activity.activity_date|user_datetime if activity.activity_date else '' }} {% if activity.creator %} · {{ _('by') }} {{ activity.creator.display_name if activity.creator.display_name else activity.creator.email }} {% endif %}

{% if activity.description %}

{{ activity.description }}

{% endif %}
{{ activity.type|title }}
{% endfor %}
{% else %}

{{ _('No activities recorded yet') }}

{{ _('Add first activity') }} {% endif %}
{% endblock %}