{% extends "base.html" %} {% block title %}Website Leads • Crystal Nexus{% endblock %} {% block header %}Website Leads{% endblock %} {% block content %}
LMSCom • Live Lead Intake

Website Lead Inbox

New leads are imported and auto-assigned using state, region, unknown-location and fallback rules.
{% if current_user.has_perm('external_leads.manage_rules') %} Location Rules {% endif %} {% if current_user.has_perm('external_leads.assign') %} {% endif %} {% if current_user.has_perm('external_leads.sync') %} {% endif %}
{% if sync_error %}
External database sync could not run: {{ sync_error }}
{% endif %}
Total Imported
{{ total_imported }}
Filtered Results
{{ pagination.total }}
Assigned
{{ total_assigned }}
Waiting for Rule
{{ total_unassigned }}
{% for item in pagination.items %} {% set detected_region = get_region_for_location(item.normalized_location) %} {% else %} {% endfor %}
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.
{% if pagination.pages > 1 %} {% endif %}
{% endblock %}