{% extends "base.html" %} {% block title %}Website Leads • Crystal Nexus{% endblock %} {% block header %}Website Leads{% endblock %} {% block content %}
| External ID | Created | Company / Contact | Email / Phone | Location / Region | Description | Assignment Status | Mode | Local Lead | Action |
|---|---|---|---|---|---|---|---|---|---|
| #{{ item.external_lead_id }} |
{{ item.external_created_at.strftime('%d %b %Y') if item.external_created_at else '—' }}
{{ item.external_created_at.strftime('%I:%M %p') if item.external_created_at else '' }}
|
{{ item.company_name or '—' }}
{{ item.contact_person or 'No contact name' }}
|
{{ item.email or '—' }}
{{ item.phone or '—' }}
|
{% set raw_location = (item.source_location or '')|trim %}
{% set raw_location_lower = raw_location|lower %}
{% set invalid_locations = ['na', 'n/a', 'none', 'null', 'unknown', '-', '--'] %}
{% if raw_location and raw_location_lower not in invalid_locations %}
{{ raw_location }}
{% elif item.ip_location %}
{{ item.ip_location|title }}
Detected from IP
{% elif item.normalized_location %}
{{ item.normalized_location|title }}
{% else %}
Unspecified
{% endif %}
{% if detected_region %}
Region: {{ detected_region|replace('_', ' ')|title }}
{% else %}
Region: Unknown
{% endif %}
|
{{ item.lead_description or '—' }} |
{% if item.assigned_user %}
{{ item.assigned_user.name }}
Assigned successfully
{% else %}
Waiting for Rule
No active matching rule found
{% endif %}
|
{% if item.assignment_mode == 'AUTO' %} Automatic {% elif item.assignment_mode == 'MANUAL' %} Manual {% else %} Unassigned {% endif %} | {% if item.local_lead %} {{ item.local_lead.lead_code }} {% else %} — {% endif %} | {% if current_user.has_perm('external_leads.assign') %} {% else %} — {% endif %} |
| No website leads found for the selected filters. | |||||||||