{% extends "./base.html" %} {% load static %} {% load humanize %} {% block page_title %}School Management Dashboard{% endblock %} {% block content %}
{% if is_teacher_dashboard %}

Teacher Dashboard Overview

Welcome back, {{ user.get_full_name|default:user.username }} {% if current_year and current_term %} Term {{ current_term.term }} {{ current_year.academic_year }} {% endif %}

Focus area: teaching, assessments, and class progress
My Class
PRIMARY FIVE
Stream Blue
Total Students
{{ total_students|default:0 }}
In my class
Present Today
24
Attendance
Absent Today
2
Attendance

Event Calendar

{% if dashboard_events %}
{% for event in dashboard_events %}
{{ event.title }}
{{ event.start_datetime|date:"M d, H:i" }}
Event
{% endfor %}
{% else %}
No upcoming events.
{% endif %}

Notice Board

{% if dashboard_announcements %}
{% for note in dashboard_announcements %}
{{ note.title }}
{{ note.starts_at|date:"M d" }}
{% if note.priority == 'high' %} High {% elif note.priority == 'low' %} Low {% else %} Normal {% endif %}
{% endfor %}
{% else %}
No announcements yet.
{% endif %}

Today’s Tasks

{% if class_teacher_tasks %} {% else %}
No pending tasks for your class.
{% endif %}

Attendance Summary

Today Attendance
89%
Demo data
Chronic Absentees
5
Top 5 list

Student Alerts

    {% if class_teacher_birthdays %} {% for student in class_teacher_birthdays %}
  • {{ student.student_name }} Birthday today
  • {% endfor %} {% else %}
  • No birthdays today
  • {% endif %}

Recent Finance Transactions

{% if recent_payments %}
    {% for payment in recent_payments %}
  • {{ payment.bill.student.student_name }} UGX {{ payment.amount|intcomma }} • {{ payment.payment_date|date:"M d" }}
  • {% endfor %}
{% else %}
No recent finance transactions.
{% endif %}

Pending Approvals

{% if pending_approvals %}
    {% for approval in pending_approvals %}
  • {{ approval.expenditure.title|default:"Expenditure" }} UGX {{ approval.expenditure.total_amount|default:approval.expenditure.amount|intcomma }}
  • {% endfor %}
{% else %}
No pending approvals.
{% endif %}

Class Teachers Progress

{% if class_teacher_progress %}
{% for row in class_teacher_progress %} {% endfor %}
Teacher Subject Class Progress Total Marked Pending Batch Status
{{ row.teacher }} {{ row.subject }} {{ row.class_name }} {{ row.stream }}
{{ row.progress }}%
{{ row.total }} {{ row.marked }} {{ row.pending }} {% if row.batch_status == "VERIFIED" %} VERIFIED {% elif row.batch_status == "PENDING" %} PENDING {% else %} DRAFT {% endif %}
{% else %}
No progress data available.
{% endif %}
{% if class_distribution %}

Class Distribution

{% for class_data in class_distribution %}
{{ class_data.current_class__name }}

{{ class_data.count }}

Students {% if is_teacher_dashboard %}
Male {{ class_data.male_count|default:0 }} Female {{ class_data.female_count|default:0 }}
{% endif %}
{% endfor %}
{% endif %} {% elif is_head_dashboard %}

Head Master Overview

Welcome back, {{ user.get_full_name|default:user.username }} {% if current_year and current_term %} Term {{ current_term.term }} {{ current_year.academic_year }} {% endif %}

School performance and operational oversight
Total Staff
{{ total_staff|default:0 }}
Active members
Total Students
{{ total_students|default:0 }}
Enrolled
Active Classes
{{ active_classes|default:0 }}
Running
Assessment Completion
{{ assessment_completion_rate|default:0 }}%
Current term

Key Highlights

Total Subjects
{{ total_subjects|default:0 }}
Active curriculum subjects
Result Status
{{ assessment_completion_rate|default:0 }}%
Verified + pending

Notice Board

{% if dashboard_announcements %}
    {% for note in dashboard_announcements %}
  • {{ note.title }} ({{ note.starts_at|date:"M d" }})
  • {% endfor %}
{% else %}
No announcements yet.
{% endif %}

Recent Registrations

{% if recent_registrations %}
    {% for student in recent_registrations %}
  • {{ student.student_name }} {{ student.current_class.name }} • Reg: {{ student.reg_no }}
  • {% endfor %}
{% else %}
No recent registrations
{% endif %}

Class Distribution

{% if class_distribution %}
{% for class_data in class_distribution %}
{{ class_data.current_class__name }}

{{ class_data.count }}

Students
{% endfor %}
{% else %}
No class distribution data.
{% endif %}

Financial Snapshot

UGX {{ total_fees_collected|intcomma }}

Fees Collected

UGX {{ total_fees_outstanding|intcomma }}

Outstanding

UGX {{ budget_allocated|intcomma }}
Budget Allocated
UGX {{ budget_spent|intcomma }}
Expenditure

Finance Trends

Fees Collection vs Expected

Expenses Breakdown

{% else %}

Dashboard Overview

Welcome back, {{ user.get_full_name|default:user.username }} {% if current_year and current_term %} Term {{ current_term.term }} {{ current_year.academic_year }} {% endif %}

{% if is_academic %} Add Student {% endif %} {% if is_admin %} Add Staff {% endif %} {% if is_finance %} Create Bill {% endif %}
{% if not is_support %}
Total Staff
{{ total_staff|default:0 }}
Active members
{% endif %} {% if is_academic %}
Total Students
{{ total_students|default:0 }}
Enrolled
Active Classes
{{ active_classes|default:0 }}
Running
{% endif %} {% if is_finance %}
Pending Tasks
{{ pending_tasks|default:0 }}
Requires attention
{% endif %}
{% if is_academic or is_finance %}

Highlights

{% if is_academic %}
Assessment Completion
{{ assessment_completion_rate|default:0 }}%
Current term
Total Subjects
{{ total_subjects|default:0 }}
Active curriculum subjects
{% endif %} {% if is_finance %}
Fee Collection Rate
{{ fee_collection_rate|default:0 }}%
Current term
{% endif %}
{% endif %} {% if is_academic %}

Class & Subject Performance

Grade Distribution

Top 5 Classes

{% if top_classes %}
    {% for c in top_classes %}
  • {{ c.assessment__academic_class__Class__name }} Avg {{ c.avg_score|floatformat:1 }}
  • {% endfor %}
{% else %}
No class data available.
{% endif %}

Bottom 5 Classes

{% if bottom_classes %}
    {% for c in bottom_classes %}
  • {{ c.assessment__academic_class__Class__name }} Avg {{ c.avg_score|floatformat:1 }}
  • {% endfor %}
{% else %}
No class data available.
{% endif %}

Top 5 Subjects

{% if top_subjects %}
    {% for s in top_subjects %}
  • {{ s.assessment__subject__name }} Avg {{ s.avg_score|floatformat:1 }}
  • {% endfor %}
{% else %}
No subject data available.
{% endif %}

Bottom 5 Subjects

{% if bottom_subjects %}
    {% for s in bottom_subjects %}
  • {{ s.assessment__subject__name }} Avg {{ s.avg_score|floatformat:1 }}
  • {% endfor %}
{% else %}
No subject data available.
{% endif %}

Performance Trends

Result Processing Status

{% endif %} {% if is_finance %}

Fees Collection vs Expected

Expenses Breakdown

Monthly Collections

{% endif %} {% if is_finance %}

Financial Summary

UGX {{ total_fees_collected|intcomma }}

Fees Collected

UGX {{ total_fees_outstanding|intcomma }}

Outstanding

{{ paid_bills }}

Paid

{{ unpaid_bills }}

Pending

{{ overdue_bills }}

Overdue

Budget Overview

UGX {{ budget_allocated|intcomma }}

Total Budget
UGX {{ budget_spent|intcomma }}
Spent
UGX {{ budget_remaining|intcomma }}
Remaining
{% endif %}

Event Calendar

{% if dashboard_events %}
    {% for event in dashboard_events %}
  • {{ event.title }} {{ event.start_datetime|date:"M d, H:i" }}
  • {% endfor %}
{% else %}
No upcoming events.
{% endif %}

Notice Board

{% if dashboard_announcements %}
    {% for note in dashboard_announcements %}
  • {{ note.title }} {{ note.starts_at|date:"M d" }}
  • {% endfor %}
{% else %}
No announcements yet.
{% endif %}

Recent Activities

{% if is_finance and recent_payments %}
    {% for payment in recent_payments %}
  • {{ payment.bill.student.student_name }}

  • {% endfor %}
{% elif is_academic and recent_registrations %}
    {% for student in recent_registrations %}
  • {{ student.student_name }}

  • {% endfor %}
{% else %}
No Recent Activities
Recent activities will appear here
{% endif %}
{% if is_academic and class_distribution %}

Class Distribution

{% for class_data in class_distribution %}
{{ class_data.current_class__name }}

{{ class_data.count }}

Students
{% endfor %}
{% endif %} {% endif %} {% endblock %}