{% extends 'base.html' %} {% load i18n static humanize %} {% load crispy_forms_tags %} {% block title %} {% trans "Lead Detail" %} {% endblock %} {% block customCSS %} {% endblock customCSS %} {% block content %}
{% include "crm/leads/partials/update_action.html" %}

{{ _("Lead Details") }}

{{ lead.first_name|capfirst }} {{ lead.last_name|capfirst }}

{{ lead.email|capfirst }}

{{ _("Status") }} {% if lead.status == "new" %} {{ _("New") }} {% elif lead.status == "contacted" %} {{ _("Contacted") }} {% elif lead.status == "qualified" %} {{ _("Qualified") }} {% elif lead.status == "unqualified" %} {{ _("Unqualified") }} {% elif lead.status == "converted" %} {{ _("Converted") }} {% endif %}
{{ _("Car Requested") }}
{% if lead.id_car_make.logo %} Car Make Logo {% endif %}

{{ lead.id_car_make.get_local_name }} - {{ lead.id_car_model.get_local_name }} {{ lead.year }}

{{ _("Assigned To") }}
{% if lead.staff.logo %} Logo {% endif %}
{% if lead.staff == request.staff %} {{ _("Me") }} {% elif LANGUAGE_CODE == "en" %} {{ lead.staff.fullname|capfirst }} {% else %} {{ lead.staff.arabic_name }} {% endif %}
{{ _("Related Records") }}
{{ _("Opportunity") }}
{% if lead.opportunity %} {{ lead.opportunity }} {% else %}

{{ _("No Opportunity") }}

{% endif %}
{{ _("Email") }}
{{ lead.email }}
{{ _("Phone") }}
{{ lead.phone_number }}
{{ _("Created") }}
{{ lead.created|naturalday|capfirst }}
{{ _("Lead Source") }}
{% if lead.source == 'REFERRALS' %} {% elif lead.source == 'WHATSAPP' %} {% elif lead.source == 'SHOWROOM' %} {% elif lead.source == 'TIKTOK' %} {% elif lead.source == 'INSTAGRAM' %} {% elif lead.source == 'X' %} {% elif lead.source == 'FACEBOOK' %} {% elif lead.source == 'MOTORY' %} {% elif lead.source == 'INFLUENCERS' %} {% elif lead.source == 'YOUTUBE' %} {% elif lead.source == 'CAMPAIGN' %} {% endif %} {{ lead.source|upper }}
{{ _("Lead Channel") }}
{{ lead.channel|upper }}
{{ _("Address") }}
{{ lead.address }}
{{ lead.status|capfirst }}
  {% trans "Current Stage" %}
{{ lead.next_action|capfirst }}
  {% trans "Next Action" %} :  {{ lead.next_action_date|naturalday|capfirst }}

{{ _("Activities") }} ({{ activities.count }})

{% if perms.inventory.change_lead %}{% endif %}
{% for activity in activities %}
{% if activity.activity_type == "call" %} {% elif activity.activity_type == "note" %} {% elif activity.activity_type == "task" %} {% elif activity.activity_type == "email" %} {% elif activity.activity_type == "visit" %} {% elif activity.activity_type == "whatsapp" %} {% elif activity.activity_type == "meeting" %} {% endif %}
{% if forloop.last %} {% else %} {% endif %}
{{ activity.activity_type|capfirst }}

{{ activity.created|naturalday|capfirst }}

{{ _("created by") }} {{ activity.created_by }}

{{ activity.notes }}

{% endfor %}

{{ _("Opportunities") }} ({{ lead.get_opportunities.count }})

{% if perms.inventory.add_opportunity %} {{ _("Add Opportunity") }} {% endif %}
{% for opportunity in lead.get_opportunities %} {% endfor %}
{{ _("Car") }} {{ _("Probability") }} {{ _("Priority") }}
{{ opportunity.car }} {{ opportunity.probability }} {{ opportunity.priority|capfirst }} View

{{ _("Notes") }}

{% if perms.inventory.change_lead %} {% endif %}
{% for note in notes %} {% endfor %}
{{ _("Note") }} {{ _("Created On") }} {{ _("Last Updated") }}
{{ note.note }} {{ note.created|naturalday|capfirst }} {{ note.updated|naturalday|capfirst }} {% if note.created_by == request.user %} {{ _("Update") }} {% endif %}

{{ _("Emails") }}

{% if perms.inventory.change_lead %} {% comment %} {% endcomment %} {% endif %}
{% for email in emails.sent %} {% endfor %}
{{ _("Subject") }} {{ _("Sent by") }} {{ _("Date") }} {{ _("Action") }} {{ _("Status") }}
{{ email.subject }}
{{ email.to_email }}
{{ email.from_email }} {{ email.created|naturalday }} {%trans "Call"%} {%trans "sent"%}
{% for email in emails.draft %} {% endfor %}
{% trans "Subject" %} {% trans "Sent by" %} {% trans "Date" %} {% trans "Action" %} {% trans "Status" %}
{{ email.subject }}
{{ email.to_email }}
{{ email.from_email }} {{ email.created }} Send draft
{% comment %} {% endcomment %}

{{ _("Tasks") }}

{% if perms.inventory.change_lead %} {% comment %} {% endcomment %} {% endif %}
{% for task in schedules %} {% include "partials/task.html" %} {% endfor %}
{%trans "Name"%} {%trans "Note"%} {%trans "Due Date"%} {%trans "Completed"%}
{% include 'modal/delete_modal.html' %} {% include "components/email_modal.html" %} {% include "components/task_modal.html" with content_type="lead" slug=lead.slug %} {% include "components/note_modal.html" with content_type="lead" slug=lead.slug %} {% include "components/schedule_modal.html" with content_type="lead" slug=lead.slug %} {% endblock content %} {% block customJS %} {% endblock customJS %}