fix(classrooms): excluir reservas pasadas de próximas clases y cursadas activas (v3.8.11)
This commit is contained in:
@@ -11,6 +11,13 @@ El formato está basado en [Keep a Changelog](https://keepachangelog.com/es-ES/1
|
|||||||
- **Sincronización Continua Moodle (Fase 6):** Automatización de workers persistentes en background para el procesamiento continuo de la cola de Web Services Moodle 4.1.
|
- **Sincronización Continua Moodle (Fase 6):** Automatización de workers persistentes en background para el procesamiento continuo de la cola de Web Services Moodle 4.1.
|
||||||
- **Pruebas de Carga y Hardening (Fase 6):** Pruebas de estrés de concurrencia y validación final de producción.
|
- **Pruebas de Carga y Hardening (Fase 6):** Pruebas de estrés de concurrencia y validación final de producción.
|
||||||
|
|
||||||
|
## [3.8.11] - 2026-10-26
|
||||||
|
### Fixed
|
||||||
|
- **Exclusión de Reservas Pasadas en Fichas y Tarjetas de Aulas (`view_classroom` y `list_classrooms`)**:
|
||||||
|
- En la ficha del aula (`/classrooms/view_classroom`), se separaron estrictamente las reservas próximas vigentes (`upcoming_reservations`) de las ya concluidas (`past_reservations`). Las clases cuya fecha u hora ya pasó (como las del 21/10/2026) ya no aparecen en "Próximas Clases y Reservas", mostrando el empty state correspondiente e incorporando una sección colapsable de historial de clases finalizadas.
|
||||||
|
- En las tarjetas del catálogo de aulas (`/classrooms/list_classrooms`), se calculan las `assigned_commissions` y `total_classes` exclusivamente a partir de reservas activas/vigentes de hoy en adelante, evitando que reservas finalizadas continúen figurando como cursadas activas del aula.
|
||||||
|
- En el modal de vista previa de salas virtuales, se preformatearon las fechas y horarios de sesiones, indicando con badge "Finalizada" las sesiones pertenecientes a fechas pasadas.
|
||||||
|
|
||||||
## [3.8.10] - 2026-10-26
|
## [3.8.10] - 2026-10-26
|
||||||
### Fixed
|
### Fixed
|
||||||
- **Sincronización y Consistencia de Salas Virtuales y Aulas (`/classrooms` vs `/dashboard`)**:
|
- **Sincronización y Consistencia de Salas Virtuales y Aulas (`/classrooms` vs `/dashboard`)**:
|
||||||
|
|||||||
@@ -9,13 +9,12 @@ Memoria del proyecto entre sesiones para la rama `dev`.
|
|||||||
- Libro de Calificaciones (*Gradebook*) con actas de regularidad inmutables.
|
- Libro de Calificaciones (*Gradebook*) con actas de regularidad inmutables.
|
||||||
- Autenticación híbrida (Google OAuth 2.0, Moodle SSO, Local) y Modo Impersonación.
|
- Autenticación híbrida (Google OAuth 2.0, Moodle SSO, Local) y Modo Impersonación.
|
||||||
- Reinicialización segura del sistema con contraseña de Administrador.
|
- Reinicialización segura del sistema con contraseña de Administrador.
|
||||||
- **Sprint Activo: Sincronización y Consistencia de Salas Virtuales y Aulas — v3.8.10**:
|
- **Sprint Activo: Exclusión de Reservas Pasadas en Aulas y Fichas — v3.8.11**:
|
||||||
- **Sincronización Consistente entre Dashboard y Aulas (`/classrooms`)**:
|
- **Exclusión de Reservas Pasadas en Fichas y Tarjetas de Aulas (`view_classroom` y `list_classrooms`)**:
|
||||||
- Subsanada la discrepancia donde el Dashboard mostraba 19 salas virtuales y la vista de Aulas solo mostraba 1 sala y el catálogo virtual vacío.
|
- Separadas reservas próximas vigentes de reservas concluidas en `handleViewClassroom`. Las clases de fechas anteriores (ej. 21/10/2026) ya no se muestran en "Próximas Clases y Reservas", mostrando el empty state correspondiente e incorporando una sección colapsable de historial de clases finalizadas.
|
||||||
- Implementado `GET /api/v1/classrooms/virtual-rooms` en FastAPI devolviendo el catálogo consolidado de salas virtuales a demanda, comisiones, enlaces Meet y métricas.
|
- Filtradas las cursadas asignadas y `total_classes` en las tarjetas de `list_classrooms` para considerar exclusivamente reservas activas de hoy en adelante, evitando que reservas pasadas continúen figurando como cursadas activas.
|
||||||
- Normalizados campos (`commission_code`, `day_count`, `week_count`, `month_count`, `total_count`, `reservations`) en `DashboardService` y en `frontend/src/routes/classrooms.js`.
|
- Preformateadas fechas y estados ("Finalizada") en el modal de sesiones del Campus Virtual.
|
||||||
- Eliminadas fechas fijas de septiembre de 2026 y reemplazadas por cómputo temporal dinámico con `new Date()`.
|
- **Versión Consolidada**: `v3.8.11`.
|
||||||
- **Versión Consolidada**: `v3.8.10`.
|
|
||||||
|
|
||||||
## Decisiones (y por qué)
|
## Decisiones (y por qué)
|
||||||
- **Flujo Secuencial de Bedelía (9 Pasos)**: Estandarizar la carga operativa en: 1) Sede -> 2) Aula -> 3) Ciclo Lectivo -> 4) Carrera -> 5) Materia (vinculada a Carrera) -> 6) Comisión (asociada a Materia, Carrera y Ciclo) -> 7) Profesores -> 8) Alumnos -> 9) Reserva de Espacio. Esto asegura consistencia e integridad relacional.
|
- **Flujo Secuencial de Bedelía (9 Pasos)**: Estandarizar la carga operativa en: 1) Sede -> 2) Aula -> 3) Ciclo Lectivo -> 4) Carrera -> 5) Materia (vinculada a Carrera) -> 6) Comisión (asociada a Materia, Carrera y Ciclo) -> 7) Profesores -> 8) Alumnos -> 9) Reserva de Espacio. Esto asegura consistencia e integridad relacional.
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from typing import Any
|
|||||||
from database import db, get_db, engine, SessionLocal, session
|
from database import db, get_db, engine, SessionLocal, session
|
||||||
from config.config import Config
|
from config.config import Config
|
||||||
|
|
||||||
__version__ = "3.8.10"
|
__version__ = "3.8.11"
|
||||||
|
|
||||||
class DummyContext:
|
class DummyContext:
|
||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="edu-space-admin",
|
name="edu-space-admin",
|
||||||
version="3.8.10",
|
version="3.8.11",
|
||||||
description="Administrative interface for Edu-Space Classroom Management System (FastAPI ASGI Core)",
|
description="Administrative interface for Edu-Space Classroom Management System (FastAPI ASGI Core)",
|
||||||
author="Edu-Space Development Team",
|
author="Edu-Space Development Team",
|
||||||
author_email="admin@edu-space.com",
|
author_email="admin@edu-space.com",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "frontend",
|
"name": "frontend",
|
||||||
"version": "3.8.10",
|
"version": "3.8.11",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
+3
-3
@@ -86,9 +86,9 @@ const env = nunjucks.configure(path.join(__dirname, '../views'), {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Versiones institucionales del sistema
|
// Versiones institucionales del sistema
|
||||||
const APP_VERSION = '3.8.10';
|
const APP_VERSION = '3.8.11';
|
||||||
const FRONTEND_VERSION = '3.8.10';
|
const FRONTEND_VERSION = '3.8.11';
|
||||||
const BACKEND_VERSION = '3.8.10';
|
const BACKEND_VERSION = '3.8.11';
|
||||||
|
|
||||||
env.addGlobal('app_version', APP_VERSION);
|
env.addGlobal('app_version', APP_VERSION);
|
||||||
env.addGlobal('frontend_version', FRONTEND_VERSION);
|
env.addGlobal('frontend_version', FRONTEND_VERSION);
|
||||||
|
|||||||
@@ -122,6 +122,24 @@ const handleClassroomsList = async (req, res) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 2. Fechas operativas dinámicas calculadas desde el momento actual
|
||||||
|
const now = new Date();
|
||||||
|
const todayIso = now.toISOString().split('T')[0];
|
||||||
|
|
||||||
|
const dayOfWeek = now.getDay();
|
||||||
|
const diffToMonday = (dayOfWeek === 0 ? -6 : 1) - dayOfWeek;
|
||||||
|
const monday = new Date(now);
|
||||||
|
monday.setDate(now.getDate() + diffToMonday);
|
||||||
|
const sunday = new Date(monday);
|
||||||
|
sunday.setDate(monday.getDate() + 6);
|
||||||
|
const weekStartIso = monday.toISOString().split('T')[0];
|
||||||
|
const weekEndIso = sunday.toISOString().split('T')[0];
|
||||||
|
|
||||||
|
const firstDayOfMonth = new Date(now.getFullYear(), now.getMonth(), 1);
|
||||||
|
const lastDayOfMonth = new Date(now.getFullYear(), now.getMonth() + 1, 0);
|
||||||
|
const monthStartIso = firstDayOfMonth.toISOString().split('T')[0];
|
||||||
|
const monthEndIso = lastDayOfMonth.toISOString().split('T')[0];
|
||||||
|
|
||||||
// Normalizar campos de salas virtuales para garantizar compatibilidad con plantillas Nunjucks
|
// Normalizar campos de salas virtuales para garantizar compatibilidad con plantillas Nunjucks
|
||||||
virtual_rooms = virtual_rooms.map(room => ({
|
virtual_rooms = virtual_rooms.map(room => ({
|
||||||
...room,
|
...room,
|
||||||
@@ -130,7 +148,21 @@ const handleClassroomsList = async (req, res) => {
|
|||||||
week_count: room.week_count !== undefined ? room.week_count : (room.week_classes || 0),
|
week_count: room.week_count !== undefined ? room.week_count : (room.week_classes || 0),
|
||||||
month_count: room.month_count !== undefined ? room.month_count : (room.month_classes || 0),
|
month_count: room.month_count !== undefined ? room.month_count : (room.month_classes || 0),
|
||||||
total_count: room.total_count !== undefined ? room.total_count : (room.res_count || 0),
|
total_count: room.total_count !== undefined ? room.total_count : (room.res_count || 0),
|
||||||
reservations: room.reservations || []
|
reservations: (room.reservations || []).map(r => {
|
||||||
|
const sStr = String(r.start_time || '');
|
||||||
|
const eStr = String(r.end_time || '');
|
||||||
|
const dPart = sStr.includes('T') ? sStr.split('T')[0] : (sStr.split(' ')[0] || '');
|
||||||
|
const isPast = dPart < todayIso;
|
||||||
|
const sTime = sStr.includes('T') ? sStr.split('T')[1].substring(0, 5) : (sStr.split(' ')[1] ? sStr.split(' ')[1].substring(0, 5) : sStr);
|
||||||
|
const eTime = eStr.includes('T') ? eStr.split('T')[1].substring(0, 5) : (eStr.split(' ')[1] ? eStr.split(' ')[1].substring(0, 5) : eStr);
|
||||||
|
return {
|
||||||
|
...r,
|
||||||
|
date_clean: dPart,
|
||||||
|
time_clean: `${sTime} a ${eTime} hs`,
|
||||||
|
is_past: isPast,
|
||||||
|
status_display: isPast ? 'Finalizada' : (r.status || 'CONFIRMED')
|
||||||
|
};
|
||||||
|
})
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Si la búsqueda está activa en modo virtual, filtrar el catálogo de salas virtuales
|
// Si la búsqueda está activa en modo virtual, filtrar el catálogo de salas virtuales
|
||||||
@@ -150,24 +182,6 @@ const handleClassroomsList = async (req, res) => {
|
|||||||
virtual_count = allClassrooms.filter(c => Boolean(c.is_virtual || (c.code || '').includes('VIRTUAL'))).length;
|
virtual_count = allClassrooms.filter(c => Boolean(c.is_virtual || (c.code || '').includes('VIRTUAL'))).length;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. Fechas operativas dinámicas calculadas desde el momento actual
|
|
||||||
const now = new Date();
|
|
||||||
const todayIso = now.toISOString().split('T')[0];
|
|
||||||
|
|
||||||
const dayOfWeek = now.getDay();
|
|
||||||
const diffToMonday = (dayOfWeek === 0 ? -6 : 1) - dayOfWeek;
|
|
||||||
const monday = new Date(now);
|
|
||||||
monday.setDate(now.getDate() + diffToMonday);
|
|
||||||
const sunday = new Date(monday);
|
|
||||||
sunday.setDate(monday.getDate() + 6);
|
|
||||||
const weekStartIso = monday.toISOString().split('T')[0];
|
|
||||||
const weekEndIso = sunday.toISOString().split('T')[0];
|
|
||||||
|
|
||||||
const firstDayOfMonth = new Date(now.getFullYear(), now.getMonth(), 1);
|
|
||||||
const lastDayOfMonth = new Date(now.getFullYear(), now.getMonth() + 1, 0);
|
|
||||||
const monthStartIso = firstDayOfMonth.toISOString().split('T')[0];
|
|
||||||
const monthEndIso = lastDayOfMonth.toISOString().split('T')[0];
|
|
||||||
|
|
||||||
const dateFilters = {
|
const dateFilters = {
|
||||||
today: todayIso,
|
today: todayIso,
|
||||||
week_start: weekStartIso,
|
week_start: weekStartIso,
|
||||||
@@ -194,8 +208,18 @@ const handleClassroomsList = async (req, res) => {
|
|||||||
// Formatear aulas físicas y calcular métricas de ocupación en base al calendario activo
|
// Formatear aulas físicas y calcular métricas de ocupación en base al calendario activo
|
||||||
const formattedItems = filtered.map(c => {
|
const formattedItems = filtered.map(c => {
|
||||||
const c_res = allReservations.filter(r => (c.id !== undefined && (String(r.classroom_id) === String(c.id) || (r.classroom && String(r.classroom.id) === String(c.id)))));
|
const c_res = allReservations.filter(r => (c.id !== undefined && (String(r.classroom_id) === String(c.id) || (r.classroom && String(r.classroom.id) === String(c.id)))));
|
||||||
|
|
||||||
|
// Filtrar únicamente reservas activas y vigentes (de hoy en adelante) para las cursadas asignadas del aula
|
||||||
|
const nowIso = now.toISOString();
|
||||||
|
const active_c_res = c_res.filter(r => {
|
||||||
|
const rawEnd = r.end_time ? String(r.end_time).replace(' ', 'T') : '';
|
||||||
|
const rawStart = r.start_time ? String(r.start_time).replace(' ', 'T') : '';
|
||||||
|
const datePart = rawStart.split('T')[0];
|
||||||
|
return datePart >= todayIso || (rawEnd && rawEnd >= nowIso);
|
||||||
|
});
|
||||||
|
|
||||||
const commMap = new Map();
|
const commMap = new Map();
|
||||||
c_res.forEach(r => {
|
active_c_res.forEach(r => {
|
||||||
const cid = r.commission_id || (r.commission && r.commission.id) || r.id;
|
const cid = r.commission_id || (r.commission && r.commission.id) || r.id;
|
||||||
if (!commMap.has(cid)) {
|
if (!commMap.has(cid)) {
|
||||||
commMap.set(cid, {
|
commMap.set(cid, {
|
||||||
@@ -237,7 +261,8 @@ const handleClassroomsList = async (req, res) => {
|
|||||||
floor_display: c.floor_display || (c.floor === '0' || c.floor === 'PB' ? 'Planta Baja' : `Piso ${c.floor}`),
|
floor_display: c.floor_display || (c.floor === '0' || c.floor === 'PB' ? 'Planta Baja' : `Piso ${c.floor}`),
|
||||||
resources: c.resources || [],
|
resources: c.resources || [],
|
||||||
assigned_commissions: Array.from(commMap.values()),
|
assigned_commissions: Array.from(commMap.values()),
|
||||||
total_classes: c_res.length
|
total_classes: active_c_res.length,
|
||||||
|
historical_classes: c_res.length
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -440,6 +465,7 @@ const handleViewClassroom = async (req, res) => {
|
|||||||
try {
|
try {
|
||||||
let classroom = null;
|
let classroom = null;
|
||||||
let upcomingReservations = [];
|
let upcomingReservations = [];
|
||||||
|
let pastReservations = [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const cRes = await req.apiClient.get(`/classrooms/${classroomId}`);
|
const cRes = await req.apiClient.get(`/classrooms/${classroomId}`);
|
||||||
@@ -468,13 +494,17 @@ const handleViewClassroom = async (req, res) => {
|
|||||||
classroom.code_display = classroom.code_display || classroom.code || `Aula-${classroomId}`;
|
classroom.code_display = classroom.code_display || classroom.code || `Aula-${classroomId}`;
|
||||||
classroom.building_entity = classroom.building_entity || null;
|
classroom.building_entity = classroom.building_entity || null;
|
||||||
|
|
||||||
// Fetch upcoming reservations for this classroom (encompassing full 2026 academic term)
|
// Fetch upcoming and past reservations for this classroom
|
||||||
try {
|
try {
|
||||||
|
const now = new Date();
|
||||||
|
const todayIso = now.toISOString().split('T')[0];
|
||||||
|
const nowIso = now.toISOString();
|
||||||
|
|
||||||
const rRes = await req.apiClient.get(`/reservations?classroom_id=${classroomId}&start_date=2026-08-01&end_date=2026-12-31`);
|
const rRes = await req.apiClient.get(`/reservations?classroom_id=${classroomId}&start_date=2026-08-01&end_date=2026-12-31`);
|
||||||
const allClassroomRes = (rRes.data && (rRes.data.reservations || rRes.data)) || [];
|
const allClassroomRes = (rRes.data && (rRes.data.reservations || rRes.data)) || [];
|
||||||
const dayNames = ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'];
|
const dayNames = ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'];
|
||||||
|
|
||||||
upcomingReservations = allClassroomRes.map(r => {
|
const formatReservationItem = (r) => {
|
||||||
let dateDisplayFriendly = '';
|
let dateDisplayFriendly = '';
|
||||||
let timeRangeFriendly = '';
|
let timeRangeFriendly = '';
|
||||||
let fullDisplay = '';
|
let fullDisplay = '';
|
||||||
@@ -514,7 +544,26 @@ const handleViewClassroom = async (req, res) => {
|
|||||||
start_time_display: r.start_time ? (r.start_time.includes('T') ? r.start_time.split('T')[1].substring(0, 5) : r.start_time) : '',
|
start_time_display: r.start_time ? (r.start_time.includes('T') ? r.start_time.split('T')[1].substring(0, 5) : r.start_time) : '',
|
||||||
end_time_display: r.end_time ? (r.end_time.includes('T') ? r.end_time.split('T')[1].substring(0, 5) : r.end_time) : ''
|
end_time_display: r.end_time ? (r.end_time.includes('T') ? r.end_time.split('T')[1].substring(0, 5) : r.end_time) : ''
|
||||||
};
|
};
|
||||||
}).sort((a, b) => (a.start_time || '').localeCompare(b.start_time || '')).slice(0, 30);
|
};
|
||||||
|
|
||||||
|
// Filtrar estrictamente Próximas Reservas (de hoy en adelante o no finalizadas)
|
||||||
|
const upcomingRaw = allClassroomRes.filter(r => {
|
||||||
|
const rawEnd = r.end_time ? String(r.end_time).replace(' ', 'T') : '';
|
||||||
|
const rawStart = r.start_time ? String(r.start_time).replace(' ', 'T') : '';
|
||||||
|
const datePart = rawStart.split('T')[0];
|
||||||
|
return datePart >= todayIso || (rawEnd && rawEnd >= nowIso);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Reservas pasadas (ya concluidas en fechas anteriores)
|
||||||
|
const pastRaw = allClassroomRes.filter(r => {
|
||||||
|
const rawEnd = r.end_time ? String(r.end_time).replace(' ', 'T') : '';
|
||||||
|
const rawStart = r.start_time ? String(r.start_time).replace(' ', 'T') : '';
|
||||||
|
const datePart = rawStart.split('T')[0];
|
||||||
|
return datePart < todayIso && (!rawEnd || rawEnd < nowIso);
|
||||||
|
});
|
||||||
|
|
||||||
|
upcomingReservations = upcomingRaw.map(formatReservationItem).sort((a, b) => (a.start_time || '').localeCompare(b.start_time || '')).slice(0, 30);
|
||||||
|
pastReservations = pastRaw.map(formatReservationItem).sort((a, b) => (b.start_time || '').localeCompare(a.start_time || '')).slice(0, 30);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn('Could not fetch reservations for classroom:', e.message);
|
console.warn('Could not fetch reservations for classroom:', e.message);
|
||||||
}
|
}
|
||||||
@@ -522,7 +571,8 @@ const handleViewClassroom = async (req, res) => {
|
|||||||
res.render('classrooms/view', {
|
res.render('classrooms/view', {
|
||||||
title: `${classroom.code_display} - Edu-Space Admin`,
|
title: `${classroom.code_display} - Edu-Space Admin`,
|
||||||
classroom,
|
classroom,
|
||||||
upcoming_reservations: upcomingReservations
|
upcoming_reservations: upcomingReservations,
|
||||||
|
past_reservations: pastReservations
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error in view classroom:', error.message);
|
console.error('Error in view classroom:', error.message);
|
||||||
|
|||||||
@@ -952,9 +952,9 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="text-muted">#{{ r.id }}</td>
|
<td class="text-muted">#{{ r.id }}</td>
|
||||||
<td>
|
<td>
|
||||||
<span class="fw-bold text-body">{{ r.start_time }}</span>
|
<span class="fw-bold text-body">{{ r.date_clean or r.start_time }}</span>
|
||||||
<span class="text-muted d-block font-monospace" style="font-size: 0.72rem;">
|
<span class="text-muted d-block font-monospace" style="font-size: 0.72rem;">
|
||||||
{{ r.start_time }} - {{ r.end_time }} hs
|
<i class="bi bi-clock me-1"></i>{{ r.time_clean or (r.start_time + ' - ' + r.end_time) }}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -974,9 +974,15 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
{% if r.is_past %}
|
||||||
|
<span class="badge bg-secondary-subtle text-secondary border" style="font-size: 0.68rem;">
|
||||||
|
<i class="bi bi-check2-circle me-1"></i>Finalizada
|
||||||
|
</span>
|
||||||
|
{% else %}
|
||||||
<span class="badge bg-success-subtle text-success border border-success-subtle" style="font-size: 0.68rem;">
|
<span class="badge bg-success-subtle text-success border border-success-subtle" style="font-size: 0.68rem;">
|
||||||
{{ r.status }}
|
{{ r.status }}
|
||||||
</span>
|
</span>
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-end">
|
<td class="text-end">
|
||||||
<div class="btn-group btn-group-sm">
|
<div class="btn-group btn-group-sm">
|
||||||
|
|||||||
@@ -168,6 +168,50 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if past_reservations and (past_reservations|length > 0) %}
|
||||||
|
<div class="border-top p-3 bg-body-tertiary">
|
||||||
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
|
<span class="small fw-semibold text-muted">
|
||||||
|
<i class="bi bi-clock-history me-1"></i>Historial de Clases Finalizadas ({{ past_reservations|length }})
|
||||||
|
</span>
|
||||||
|
<button class="btn btn-sm btn-link text-decoration-none p-0 text-muted" type="button" data-bs-toggle="collapse" data-bs-target="#collapsePastClasses" aria-expanded="false" style="font-size: 0.75rem;">
|
||||||
|
Ver historial anterior <i class="bi bi-chevron-down ms-1"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="collapse mt-2" id="collapsePastClasses">
|
||||||
|
<div class="table-responsive bg-body rounded border">
|
||||||
|
<table class="table table-sm table-hover align-middle mb-0" style="font-size: 0.78rem;">
|
||||||
|
<thead class="table-light">
|
||||||
|
<tr>
|
||||||
|
<th class="ps-2">Fecha y Horario</th>
|
||||||
|
<th>Materia</th>
|
||||||
|
<th>Comisión</th>
|
||||||
|
<th class="text-end pe-2">Estado</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for pres in past_reservations %}
|
||||||
|
<tr class="text-muted">
|
||||||
|
<td class="ps-2">
|
||||||
|
<i class="bi bi-check2-circle me-1 text-secondary"></i>{{ pres.date_display_friendly }} · {{ pres.time_range_friendly }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span class="fw-semibold">{{ pres.subject_name }}</span>
|
||||||
|
{% if pres.subject_code %}
|
||||||
|
<small class="badge bg-secondary-subtle text-secondary font-monospace ms-1">{{ pres.subject_code }}</small>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td><span class="badge bg-secondary-subtle text-secondary font-monospace">{{ pres.commission.code if pres.commission else 'C1' }}</span></td>
|
||||||
|
<td class="text-end pe-2"><span class="badge bg-secondary-subtle text-secondary border">Finalizada</span></td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user