{% extends "layout.html" %} {% block title %}{{ school.name }}{% endblock %} {% macro field(f) %}
{{ f }} {% for e in f.errors %}
{{ e }}
{% endfor %}
{% endmacro %} {% block content %}

← All schools

{{ school.name }}

{{ data.get('organizationCode', '') }} · {{ school.municipality }}{% if school.district_name %}, {{ school.district_name }}{% endif %}
{{ STAGE_LABELS[stage] }} {{ PRIORITY_LABELS.get((lead.priority if lead else '') or '', '-') }} priority
Last reached{{ lead.last_contacted_at|ago if lead else 'never' }}
Attempts{{ lead.attempts if lead else 0 }}
Next follow-up{{ lead.next_followup|dt if lead and lead.next_followup else '-' }}
Owner{{ lead.owner.username if lead and lead.owner else 'Unassigned' }}

Lead status & activity

{% if crm_can_edit %}
{{ csrf_input }} {% for e in lead_form.non_field_errors() %}
{{ e }}
{% endfor %}

Status and follow-up

{{ field(lead_form.stage) }}{{ field(lead_form.priority) }} {{ field(lead_form.owner) }}{{ field(lead_form.deal_value) }} {{ field(lead_form.next_followup) }}{{ field(lead_form.next_action) }}
{{ field(lead_form.lost_reason) }}

Record an activity Optional

Add a call, visit, or note here while updating the lead. Leave this blank for a status-only change.

{{ field(lead_form.activity_kind) }}{{ field(lead_form.activity_outcome) }} {{ field(lead_form.activity_occurred_at) }}
{{ field(lead_form.activity_notes) }}
{% else %}
Stage
{{ STAGE_LABELS[stage] }}
Priority
{{ PRIORITY_LABELS.get((lead.priority if lead else '') or '', '-') }}
What to do next
{{ lead.next_action if lead and lead.next_action else '-' }}

You have view-only CRM access.

{% endif %}

People at this school

{% if people %}
    {% for p in people %}
  • {{ p.name }}{% if p.is_primary %} Main{% endif %} {% if p.role %} · {{ p.role }}{% endif %}
    {% if p.phone %}{{ p.phone }}{% endif %} {% if p.email %} · {{ p.email }}{% endif %}
    {% if crm_can_edit %}
    {{ csrf_input }}
    {% endif %}
  • {% endfor %}
{% else %}

No extra contacts yet.

{% endif %} {% if crm_can_edit %}
Add a person
{{ csrf_input }}
{{ field(contact_form.name) }}{{ field(contact_form.role) }} {{ field(contact_form.phone) }}{{ field(contact_form.email) }}
{% endif %}

Timeline

{% if activities %}
    {% for a in activities %}
  • {{ a.occurred_at|dt }} · {{ a.created_by.username if a.created_by else 'system' }}
    {{ KIND_LABELS[a.kind] }}{% if a.outcome %} · {{ OUTCOME_LABELS[a.outcome] }}{% endif %}
    {% if a.notes %}
    {{ a.notes }}
    {% endif %}
  • {% endfor %}
{% else %}

No activity yet. Log your first call or visit.

{% endif %}

School details

{% for k, v in facts %}
{{ k|label }}
{% if k == 'contactNumber' %}{{ v }} {% elif k == 'email' %}{{ v }} {% else %}{{ v }}{% endif %}
{% endfor %}
{% if classes %}

Students by class

{% for k, v in classes %}
{{ k|label }}{{ v }}
{% endfor %}
{% endif %} {% if others %}
More details ({{ others|length }})
{% for k, v in others %}
{{ k|label }}
{{ 'Yes' if v is sameas true else ('No' if v is sameas false else v) }}
{% endfor %}
{% endif %}
{% endblock %} {% block scripts %} {% endblock %}