{% extends "base.html" %} {% load get_item %} {% block page_title %}Timetable Management{% endblock page_title %} {% block content %}

Timetable Management

{% if can_edit_timetable %} {% endif %} {% if selected_class %} {% endif %}
{% if selected_class %}
{% csrf_token %}
{% csrf_token %}
{% if can_lock_timetable %}
{% csrf_token %}
{% endif %}
{% endif %}
{% if selected_class %}

{{ selected_class.academic_class.Class.code }}{{ selected_class.stream.stream }} {{ selected_class.academic_class.academic_year.academic_year }} - Term {{ selected_class.academic_class.term.term }}

{% if is_timetable_locked %} Locked {% endif %}
{% if is_timetable_locked %}
Timetable is locked. The grid is read-only until unlocked by Admin.
{% endif %}
{% for weekday, label in weekdays %}
{% for slot in time_slots %} {% with break_key=weekday|stringformat:"s"|add:"_"|add:slot.id|stringformat:"s" %} {% with break_item=break_map|get_item:break_key %} {% with break_fallback=break_any_slots|get_item:slot.id %} {% with cell=timetable_data|get_item:weekday|get_item:slot.id %}
{{ slot }}
{% if break_item or break_fallback %}
BREAK
{% elif cell %}
{{ cell.subject.name }} ({{ cell.teacher|default:"-" }})
{% else %}
No lesson
{% endif %}
{% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endfor %}
{% endfor %}
{% if can_edit_timetable and not is_timetable_locked %}
{% endif %}

Class Info

Class: {{ selected_class.academic_class.Class.code }}{{ selected_class.stream.stream }}

Class Teacher: {{ selected_class.class_teacher }}

Subjects Allocated: {{ subjects_allocated_count }}

Total Students: {{ total_students }}

Teacher Conflict Alerts

{% if conflict_alerts %}
    {% for conflict in conflict_alerts %}
  • {{ conflict.message }}
  • {% endfor %}
{% else %}

No teacher clashes detected.

{% endif %}
{% else %}
Select Academic Year, Term, and Class Stream to view and build timetable.
{% endif %} {% if can_edit_timetable %} {% endif %} {{ allocation_teacher_map|json_script:"allocation-teacher-map" }} {% endblock %}