{% extends "base.html" %} {% block title %}Предметы — {{ schedule.name }}{% endblock %} {% block nav_extra %} Расписание {% if can_edit %} {% endif %} {% endblock %} {% block content %} {% from "macros/metrics.html" import render_metric %}

Предметы

{{ schedule.name }}
{% if not schedule.data %}
📋

В расписании нет предметов

{% else %}
{% for item in schedule.data %} {% set subj = item.subject %} {% set cfg = configs.get(subj) %} {% set pidx = loop.index0 %} {% set is_completed = cfg and cfg.completed %}
{# ── Шапка карточки ── #}
{% for type_name, type_data in item.get('types', {}).items() %} {% set color = type_data.get('color', 'gray') if type_data is mapping and 'color' in type_data else 'gray' %} {{ type_name }} {% endfor %}
{{ subj }} {% if cfg and cfg.completion_type %} {{ cfg.completion_type }} {% endif %} {% if is_completed %} Завершён {% endif %}
{% if can_edit %} {% endif %}
{# ── Описание ── #}

{{ cfg.description if cfg and cfg.description else 'Нет описания' }}

{% if can_edit %}
{% endif %}
{# ── Мета: тип сдачи + ссылка СДО ── #}
{# Тип сдачи #}
Тип сдачи {% if can_edit %} {% else %} {{ (cfg.completion_type if cfg and cfg.completion_type else '—') }} {% endif %}
{# Ссылка СДО #}
СДО {% if can_edit %}
{% if cfg and cfg.sdo_url %} {% endif %}
{% else %} {% if cfg and cfg.sdo_url %} Открыть {% else %} — {% endif %} {% endif %}
{# ── Расписание: по типам и периодам ── #} {% for type_name, type_data in item.get('types', {}).items() %} {% set color = type_data.get('color', 'gray') if type_data is mapping and 'color' in type_data else 'gray' %} {% set date_ranges = type_data.get('dates', type_data) if type_data is mapping and 'dates' in type_data else type_data %} {% for dr, slots in date_ranges.items() %}
{# Заголовок секции: тип + период #}
{{ type_name }} {{ dr }} {% if can_edit %} {% endif %} {% if can_edit %} {% endif %}
{# Таблица слотов #} {% if can_edit %}{% endif %} {% for slot in slots %} {% set slot_day = slot[0] if slot|length > 0 else '' %} {% set slot_time = slot[1] if slot|length > 1 else '' %} {% set slot_room = slot[2] if slot|length > 2 and slot[2] else '' %} {% set slot_teach = slot[3] if slot|length > 3 and slot[3] else '' %} {# Режим просмотра #} {% if can_edit %} {% endif %} {# Строка редактирования — скрыта по умолчанию #} {% if can_edit %} {% endif %} {% endfor %}
День Время Кабинет Преподаватель
{{ slot_day | capitalize }} {{ slot_time or '—' }} {{ slot_room or '—' }} {{ slot_teach or '—' }}
{% endfor %} {% endfor %} {# ── Кнопка добавить новый тип/период (для можно расширить позже) ── #} {# ── Трекеры ── #}
Трекеры
{% if can_edit %} {% endif %}
{% if cfg %} {% for metric in cfg.metrics %} {{ render_metric(metric, can_edit, show_rename=True) }} {% endfor %} {% endif %}
{% if can_edit %}
{% endif %}
{% endfor %}
{% endif %} {# ══ Модальное окно промта AI-трекера ══ #} {# ══ Модальное окно переименования трекера ══ #} {# ══ Модальное окно переименования ══ #} {% endblock %} {% block scripts %} {% endblock %}