{% extends "base.html" %} {% block title %}{{ saved_name }} - Timetable Generator{% endblock %} {% block content %}

{{ saved_name }}

{% if timetables %} Edit Mode Regenerate {% endif %} Back to Saved
{% if has_conflicts %}
⚠️ Teacher Scheduling Conflicts Detected ({{ conflicts|length }})

Some teachers are scheduled in multiple sections at the same time. This may be due to changes in teacher or subject data since this timetable was saved. Use Edit Mode to resolve these conflicts or Regenerate to create a new conflict-free timetable.

{% for conflict in conflicts %}
{{ conflict.teacher }} is scheduled at {{ conflict.time }} in:
    {% for i in range(conflict.sections|length) %}
  • {{ conflict.sections[i] }} - {{ conflict.subjects[i] }}
  • {% endfor %}
{% endfor %}
{% endif %} {% if timetables %} {% for timetable in timetables %}

{{ timetable.section_name }} ({{ timetable.section_year }})

{% for period in timetable.periods %} {% endfor %} {% for day_index in range(6) %} {% set skip_cells = [] %} {% for period_index in range(8) %} {% if period_index not in skip_cells %} {% set subject = timetable.schedule[day_index][period_index] %} {% if subject %} {% else %} {% endif %} {% endif %} {% endfor %} {% endfor %}
Day{{ period }}
{{ timetable.days[day_index] }} 1 %}colspan="{{ subject.colspan }}"{% endif %}> {% if subject.is_lunch %}
LUNCH
Break Time
{% elif subject.get('is_merged_lab', False) %}
{{ subject.name }}
{{ subject.teacher }}
{{ subject.block_size }}-Period Lab Block
{% for span_index in range(1, subject.colspan) %} {% set _ = skip_cells.append(period_index + span_index) %} {% endfor %} {% else %}
{{ subject.name }}
{{ subject.teacher }} {% if subject.is_lab %}
Lab
{% endif %}
{% endif %}
Free
Subject Summary:
{% set subject_data = {} %} {% for day in timetable.schedule %} {% for period in day %} {% if period and not period.is_lunch %} {% set _ = subject_data.update({period.name: {'count': subject_data.get(period.name, {}).get('count', 0) + 1, 'is_lab': period.is_lab}}) %} {% endif %} {% endfor %} {% endfor %} {% for subject_name, data in subject_data.items() %}
{{ data.count }} {{ subject_name }}
{% endfor %}
{% endfor %} {% else %}
No Timetables

This saved timetable has no data to display.

Back to Saved Timetables
{% endif %} {% endblock %}