feat(dashboard): add tomorrow filter to period switchers and schedule view v3.4.4

This commit is contained in:
2026-10-07 23:13:16 -03:00
parent 22c545e2df
commit f95711d77b
15 changed files with 625 additions and 27 deletions
+10
View File
@@ -11,6 +11,16 @@ 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.4.4] - 2026-10-07
### Añadido & Mejorado (Dashboard Operativo de Bedelía y Admin)
- **Filtro Temporal "Mañana" en Switchers de Período y Cartelera:**
- Incorporación del botón de filtro temporal "Mañana" (`tomorrow`) de forma homogénea en los switchers de período del dashboard:
- **Panel de Percentiles de Ocupación de Aulas Físicas:** switcher con `Día (Hoy)`, `Mañana`, `Semana` y `Mes`, calculando métricas de ocupación y aulas libres para el día siguiente.
- **Panel de Comisiones Asignadas vs Sin Asignar:** visualización inmediata de comisiones con y sin aula asignada programadas para mañana.
- **Panel de Aulas Físicas Asignadas vs Libres:** tarjetas detalladas con aulas libres con botón de asignación directa y aulas en uso para el día de mañana.
- **Cartelera Operativa & Agenda de Clases:** pestaña "Clases de Mañana" con listado completo de cursadas presenciales y virtuales activas del día siguiente.
- Soporte completo en backend (`backend/app/routes/api/dashboard.py`): cálculo de `tomorrow_dt`, estadísticas en `filter_stats['tomorrow']`, `tomorrow_schedule_list` y soporte de sincronización de datos con frontend BFF.
## [3.4.3] - 2026-10-07 ## [3.4.3] - 2026-10-07
### Añadido & Refactorizado (Sincronización Google Sheets) ### Añadido & Refactorizado (Sincronización Google Sheets)
- **Selección Granular de Entidades a Importar:** - **Selección Granular de Entidades a Importar:**
+13
View File
@@ -119,6 +119,19 @@ Memoria del proyecto entre sesiones para la rama `dev`.
- Versión incrementada a `v3.4.3` en Frontend y Backend. - Versión incrementada a `v3.4.3` en Frontend y Backend.
- Despliegue y verificación en caliente en el servidor institucional `10.0.0.217` (`https://eduspace.oemspot.com.ar`). - Despliegue y verificación en caliente en el servidor institucional `10.0.0.217` (`https://eduspace.oemspot.com.ar`).
- **Sprint Dashboard Bedelía: Filtro Temporal "Mañana" en Switchers y Cartelera (v3.4.4)**:
- **Requerimiento**: Agregar "Mañana" en el filtro actual del dashboard que decía "Día (Hoy) / Semana / Mes".
- **Implementación**:
- **Backend API (`backend/app/routes/api/dashboard.py`)**: Cálculo de `tomorrow_dt` (00:00:00 a 23:59:59), agregando estadísticas en `filter_stats['tomorrow']` para percentiles de aulas físicas y comisiones asignadas/sin asignar, y `tomorrow_schedule_list` para la agenda de clases.
- **Frontend BFF & Vistas (`frontend/views/dashboard/dashbede.html`, `dashbede.html`, `dashadm.html`, `dashboard.html`)**:
- Switcher de percentiles: botón "Mañana" con actualización dinámica de percentiles de ocupación de aulas físicas.
- Switcher de comisiones: botón "Mañana" y bloques `#commBlock-tomorrow-unassigned` y `#commBlock-tomorrow-assigned`.
- Switcher de aulas físicas: botón "Mañana" y bloques `#classBlock-tomorrow-unassigned` (aulas libres con botón "Asignar") y `#classBlock-tomorrow-assigned` (aulas en uso).
- Cartelera Operativa & Agenda de Clases: botón "Clases de Mañana" y tabla `#bedeliaScheduleTomorrow` mostrando asignaturas, comisiones, docentes y enlaces para mañana.
- **Bump Semántico y Despliegue Obligatorio (Principio 9)**:
- Versión incrementada a `v3.4.4` en Frontend y Backend.
- Despliegue al servidor institucional `10.0.0.217` (`https://eduspace.oemspot.com.ar`) y verificación en caliente.
## Próximos pasos ## Próximos pasos
1. Continuar con los objetivos de la Fase 6 del Roadmap institucional (Docker-compose productivo, Nginx con SSL y automatización de workers continuos Moodle). 1. Continuar con los objetivos de la Fase 6 del Roadmap institucional (Docker-compose productivo, Nginx con SSL y automatización de workers continuos Moodle).
2. Monitoreo continuo de la experiencia de usuario en Bedelía, Cartelera del Día y Sincronización Académica. 2. Monitoreo continuo de la experiencia de usuario en Bedelía, Cartelera del Día y Sincronización Académica.
+1 -1
View File
@@ -2,7 +2,7 @@
## Gestión de Espacios Áulicos, Asignación de Comisiones y Operatoria de Bedelía ## Gestión de Espacios Áulicos, Asignación de Comisiones y Operatoria de Bedelía
**Institución:** Universidad de la Ciudad de Buenos Aires (UniCABA) **Institución:** Universidad de la Ciudad de Buenos Aires (UniCABA)
**Versión:** 3.4.3 (Refactorización del Importador Google Sheets: Selección Granular y Grilla Interactiva) **Versión:** 3.4.4 (Dashboard Bedelía: Filtro Temporal "Mañana" en Switchers y Cartelera Operativa)
**Fecha de Actualización:** 07 de Octubre de 2026 **Fecha de Actualización:** 07 de Octubre de 2026
**Rama Base:** `dev` **Rama Base:** `dev`
+1 -1
View File
@@ -6,7 +6,7 @@ from flask_babel import Babel, gettext as _
from config.config import Config from config.config import Config
# Initialize extensions # Initialize extensions
__version__ = "3.4.3" __version__ = "3.4.4"
db = SQLAlchemy() db = SQLAlchemy()
migrate = Migrate() migrate = Migrate()
cors = CORS() cors = CORS()
+69 -6
View File
@@ -150,9 +150,13 @@ def get_stats():
upcoming_reservations = [serialize_reservation(r) for r in upcoming_reservations_q] upcoming_reservations = [serialize_reservation(r) for r in upcoming_reservations_q]
milestones = [serialize_milestone(m) for m in milestones_q] milestones = [serialize_milestone(m) for m in milestones_q]
# ---- Bedelía: Filtros completos de Aulas y Comisiones por Día, Semana y Mes ---- # ---- Bedelía: Filtros completos de Aulas y Comisiones por Día (Hoy), Mañana, Semana y Mes ----
import calendar import calendar
today_dt = datetime.utcnow() today_dt = datetime.utcnow()
tomorrow_dt = today_dt + timedelta(days=1)
tomorrow_start = tomorrow_dt.replace(hour=0, minute=0, second=0, microsecond=0)
tomorrow_end = tomorrow_dt.replace(hour=23, minute=59, second=59, microsecond=0)
week_start = today_dt - timedelta(days=today_dt.weekday()) # Lunes week_start = today_dt - timedelta(days=today_dt.weekday()) # Lunes
week_start = week_start.replace(hour=0, minute=0, second=0, microsecond=0) week_start = week_start.replace(hour=0, minute=0, second=0, microsecond=0)
week_end = week_start + timedelta(days=6, hours=23, minutes=59, seconds=59) week_end = week_start + timedelta(days=6, hours=23, minutes=59, seconds=59)
@@ -166,11 +170,16 @@ def get_stats():
meses_esp = ['', 'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'] meses_esp = ['', 'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre']
weekday_name = dias_esp[today_dt.weekday()] weekday_name = dias_esp[today_dt.weekday()]
month_name = meses_esp[today_dt.month] month_name = meses_esp[today_dt.month]
tomorrow_weekday_name = dias_esp[tomorrow_dt.weekday()]
tomorrow_month_name = meses_esp[tomorrow_dt.month]
date_labels = { date_labels = {
'today': f"Hoy · {weekday_name} {today_dt.strftime('%d/%m/%Y')}", 'today': f"Hoy · {weekday_name} {today_dt.strftime('%d/%m/%Y')}",
'today_short': f"{weekday_name} {today_dt.strftime('%d/%m')}", 'today_short': f"{weekday_name} {today_dt.strftime('%d/%m')}",
'today_full': f"{weekday_name}, {today_dt.day} de {month_name} de {today_dt.year}", 'today_full': f"{weekday_name}, {today_dt.day} de {month_name} de {today_dt.year}",
'tomorrow': f"Mañana · {tomorrow_weekday_name} {tomorrow_dt.strftime('%d/%m/%Y')}",
'tomorrow_short': f"{tomorrow_weekday_name} {tomorrow_dt.strftime('%d/%m')}",
'tomorrow_full': f"{tomorrow_weekday_name}, {tomorrow_dt.day} de {tomorrow_month_name} de {tomorrow_dt.year}",
'week': f"Semana del {week_start.strftime('%d/%m')} al {week_end.strftime('%d/%m/%Y')}", 'week': f"Semana del {week_start.strftime('%d/%m')} al {week_end.strftime('%d/%m/%Y')}",
'week_full': f"Semana del {week_start.strftime('%d/%m/%Y')} al {week_end.strftime('%d/%m/%Y')}", 'week_full': f"Semana del {week_start.strftime('%d/%m/%Y')} al {week_end.strftime('%d/%m/%Y')}",
'month': f"Mes de {month_name} {today_dt.year} ({month_start.strftime('%d/%m')} al {month_end.strftime('%d/%m/%Y')})", 'month': f"Mes de {month_name} {today_dt.year} ({month_start.strftime('%d/%m')} al {month_end.strftime('%d/%m/%Y')})",
@@ -178,6 +187,12 @@ def get_stats():
} }
# Reservas por período # Reservas por período
tomorrow_reservations_q = Reservation.query.filter(
Reservation.start_time >= tomorrow_start,
Reservation.start_time <= tomorrow_end
).order_by(Reservation.start_time.asc()).all()
tomorrow_schedule_list = [serialize_reservation(r) for r in tomorrow_reservations_q]
week_reservations_q = Reservation.query.filter( week_reservations_q = Reservation.query.filter(
Reservation.start_time >= week_start, Reservation.start_time >= week_start,
Reservation.start_time <= week_end Reservation.start_time <= week_end
@@ -195,6 +210,11 @@ def get_stats():
if r.classroom_id: if r.classroom_id:
res_map_classroom_today.setdefault(r.classroom_id, []).append(r) res_map_classroom_today.setdefault(r.classroom_id, []).append(r)
res_map_classroom_tomorrow = {}
for r in tomorrow_reservations_q:
if r.classroom_id:
res_map_classroom_tomorrow.setdefault(r.classroom_id, []).append(r)
res_map_classroom_week = {} res_map_classroom_week = {}
for r in week_reservations_q: for r in week_reservations_q:
if r.classroom_id: if r.classroom_id:
@@ -211,6 +231,11 @@ def get_stats():
if r.commission_id: if r.commission_id:
res_map_comm_today.setdefault(r.commission_id, []).append(r) res_map_comm_today.setdefault(r.commission_id, []).append(r)
res_map_comm_tomorrow = {}
for r in tomorrow_reservations_q:
if r.commission_id:
res_map_comm_tomorrow.setdefault(r.commission_id, []).append(r)
res_map_comm_week = {} res_map_comm_week = {}
for r in week_reservations_q: for r in week_reservations_q:
if r.commission_id: if r.commission_id:
@@ -273,10 +298,13 @@ def get_stats():
# 1. Hoy # 1. Hoy
classrooms_assigned_today = [build_classroom_item(c, res_map_classroom_today[c.id]) for c in physical_classrooms_list if c.id in res_map_classroom_today] classrooms_assigned_today = [build_classroom_item(c, res_map_classroom_today[c.id]) for c in physical_classrooms_list if c.id in res_map_classroom_today]
classrooms_unassigned_today = [build_classroom_item(c, []) for c in physical_classrooms_list if c.id not in res_map_classroom_today] classrooms_unassigned_today = [build_classroom_item(c, []) for c in physical_classrooms_list if c.id not in res_map_classroom_today]
# 2. Semana # 2. Mañana
classrooms_assigned_tomorrow = [build_classroom_item(c, res_map_classroom_tomorrow[c.id]) for c in physical_classrooms_list if c.id in res_map_classroom_tomorrow]
classrooms_unassigned_tomorrow = [build_classroom_item(c, []) for c in physical_classrooms_list if c.id not in res_map_classroom_tomorrow]
# 3. Semana
classrooms_assigned_week = [build_classroom_item(c, res_map_classroom_week[c.id]) for c in physical_classrooms_list if c.id in res_map_classroom_week] classrooms_assigned_week = [build_classroom_item(c, res_map_classroom_week[c.id]) for c in physical_classrooms_list if c.id in res_map_classroom_week]
classrooms_unassigned_week = [build_classroom_item(c, []) for c in physical_classrooms_list if c.id not in res_map_classroom_week] classrooms_unassigned_week = [build_classroom_item(c, []) for c in physical_classrooms_list if c.id not in res_map_classroom_week]
# 3. Mes # 4. Mes
classrooms_assigned_month = [build_classroom_item(c, res_map_classroom_month[c.id]) for c in physical_classrooms_list if c.id in res_map_classroom_month] classrooms_assigned_month = [build_classroom_item(c, res_map_classroom_month[c.id]) for c in physical_classrooms_list if c.id in res_map_classroom_month]
classrooms_unassigned_month = [build_classroom_item(c, []) for c in physical_classrooms_list if c.id not in res_map_classroom_month] classrooms_unassigned_month = [build_classroom_item(c, []) for c in physical_classrooms_list if c.id not in res_map_classroom_month]
@@ -284,10 +312,13 @@ def get_stats():
# 1. Hoy # 1. Hoy
commissions_assigned_today = [build_comm_item(comm, res_map_comm_today[comm.id]) for comm in all_active_commissions if comm.id in res_map_comm_today] commissions_assigned_today = [build_comm_item(comm, res_map_comm_today[comm.id]) for comm in all_active_commissions if comm.id in res_map_comm_today]
commissions_unassigned_today = [build_comm_item(comm, []) for comm in all_active_commissions if comm.id not in res_map_comm_today] commissions_unassigned_today = [build_comm_item(comm, []) for comm in all_active_commissions if comm.id not in res_map_comm_today]
# 2. Semana # 2. Mañana
commissions_assigned_tomorrow = [build_comm_item(comm, res_map_comm_tomorrow[comm.id]) for comm in all_active_commissions if comm.id in res_map_comm_tomorrow]
commissions_unassigned_tomorrow = [build_comm_item(comm, []) for comm in all_active_commissions if comm.id not in res_map_comm_tomorrow]
# 3. Semana
commissions_assigned_week = [build_comm_item(comm, res_map_comm_week[comm.id]) for comm in all_active_commissions if comm.id in res_map_comm_week] commissions_assigned_week = [build_comm_item(comm, res_map_comm_week[comm.id]) for comm in all_active_commissions if comm.id in res_map_comm_week]
commissions_unassigned_week = [build_comm_item(comm, []) for comm in all_active_commissions if comm.id not in res_map_comm_week] commissions_unassigned_week = [build_comm_item(comm, []) for comm in all_active_commissions if comm.id not in res_map_comm_week]
# 3. Mes # 4. Mes
commissions_assigned_month = [build_comm_item(comm, res_map_comm_month[comm.id]) for comm in all_active_commissions if comm.id in res_map_comm_month] commissions_assigned_month = [build_comm_item(comm, res_map_comm_month[comm.id]) for comm in all_active_commissions if comm.id in res_map_comm_month]
commissions_unassigned_month = [build_comm_item(comm, []) for comm in all_active_commissions if comm.id not in res_map_comm_month] commissions_unassigned_month = [build_comm_item(comm, []) for comm in all_active_commissions if comm.id not in res_map_comm_month]
@@ -310,6 +341,7 @@ def get_stats():
for comm in all_active_commissions: for comm in all_active_commissions:
if comm.id in comm_ids_virtual: if comm.id in comm_ids_virtual:
res_today = res_map_comm_today.get(comm.id, []) res_today = res_map_comm_today.get(comm.id, [])
res_tomorrow = res_map_comm_tomorrow.get(comm.id, [])
res_week = res_map_comm_week.get(comm.id, []) res_week = res_map_comm_week.get(comm.id, [])
res_month = res_map_comm_month.get(comm.id, []) res_month = res_map_comm_month.get(comm.id, [])
v_link = comm.virtual_link or (res_today[0].virtual_link if res_today and res_today[0].virtual_link else '') v_link = comm.virtual_link or (res_today[0].virtual_link if res_today and res_today[0].virtual_link else '')
@@ -331,10 +363,12 @@ def get_stats():
'building': 'Campus Virtual', 'building': 'Campus Virtual',
'floor': 'Remoto ∞', 'floor': 'Remoto ∞',
'today_classes': len(res_today), 'today_classes': len(res_today),
'tomorrow_classes': len(res_tomorrow),
'week_classes': len(res_week), 'week_classes': len(res_week),
'month_classes': len(res_month), 'month_classes': len(res_month),
'res_count': len(res_month), 'res_count': len(res_month),
'is_active_today': len(res_today) > 0, 'is_active_today': len(res_today) > 0,
'is_active_tomorrow': len(res_tomorrow) > 0,
'assigned_summary': f"{comm.subject.name if comm.subject else 'Clase Virtual'} ({comm.schedule or 'Remoto'})" 'assigned_summary': f"{comm.subject.name if comm.subject else 'Clase Virtual'} ({comm.schedule or 'Remoto'})"
}) })
@@ -355,8 +389,10 @@ def get_stats():
# Compatibilidad hacia atrás para vistas existentes # Compatibilidad hacia atrás para vistas existentes
available_classrooms_today = classrooms_unassigned_today available_classrooms_today = classrooms_unassigned_today
available_classrooms_tomorrow = classrooms_unassigned_tomorrow
available_classrooms_week = classrooms_unassigned_week available_classrooms_week = classrooms_unassigned_week
available_classrooms_month = classrooms_unassigned_month available_classrooms_month = classrooms_unassigned_month
unassigned_commissions_tomorrow = commissions_unassigned_tomorrow
unassigned_commissions_week = commissions_unassigned_week unassigned_commissions_week = commissions_unassigned_week
unassigned_commissions_month = commissions_unassigned_month unassigned_commissions_month = commissions_unassigned_month
@@ -386,6 +422,29 @@ def get_stats():
'total': total_active_commissions 'total': total_active_commissions
} }
}, },
'tomorrow': {
'label': date_labels['tomorrow'],
'date_short': date_labels['tomorrow_short'],
'date_full': date_labels['tomorrow_full'],
'classrooms': {
'assigned': classrooms_assigned_tomorrow,
'unassigned': classrooms_unassigned_tomorrow,
'assigned_count': len(classrooms_assigned_tomorrow),
'unassigned_count': len(classrooms_unassigned_tomorrow),
'assigned_pct': round((len(classrooms_assigned_tomorrow) / max(1, total_physical_count)) * 100, 1),
'unassigned_pct': round((len(classrooms_unassigned_tomorrow) / max(1, total_physical_count)) * 100, 1),
'total': total_physical_count
},
'commissions': {
'assigned': commissions_assigned_tomorrow,
'unassigned': commissions_unassigned_tomorrow,
'assigned_count': len(commissions_assigned_tomorrow),
'unassigned_count': len(commissions_unassigned_tomorrow),
'assigned_pct': round((len(commissions_assigned_tomorrow) / max(1, total_active_commissions)) * 100, 1),
'unassigned_pct': round((len(commissions_unassigned_tomorrow) / max(1, total_active_commissions)) * 100, 1),
'total': total_active_commissions
}
},
'week': { 'week': {
'label': date_labels['week'], 'label': date_labels['week'],
'date_short': date_labels['week'], 'date_short': date_labels['week'],
@@ -503,12 +562,14 @@ def get_stats():
'assigned_today_pct': assigned_today_pct, 'assigned_today_pct': assigned_today_pct,
'unassigned_today_classrooms': unassigned_today_count, 'unassigned_today_classrooms': unassigned_today_count,
'unassigned_today_pct': unassigned_today_pct, 'unassigned_today_pct': unassigned_today_pct,
'total_active_commissions': total_active_commissions 'total_active_commissions': total_active_commissions,
'tomorrow_reservations': len(tomorrow_reservations_q) if 'tomorrow_reservations_q' in locals() else 0
}, },
'audit_logs': audit_data, 'audit_logs': audit_data,
'monthly_data': monthly_data, 'monthly_data': monthly_data,
'pending_reservations': pending_reservations, 'pending_reservations': pending_reservations,
'today_schedule_list': today_schedule_list, 'today_schedule_list': today_schedule_list,
'tomorrow_schedule_list': tomorrow_schedule_list if 'tomorrow_schedule_list' in locals() else [],
'week_schedule_list': week_schedule_list, 'week_schedule_list': week_schedule_list,
'upcoming_reservations': upcoming_reservations, 'upcoming_reservations': upcoming_reservations,
'milestones': milestones, 'milestones': milestones,
@@ -516,10 +577,12 @@ def get_stats():
'show_role_banner': SystemSetting.get_value('dashboard_role_banner_enabled', 'true') in ['true', 'True', '1', True] 'show_role_banner': SystemSetting.get_value('dashboard_role_banner_enabled', 'true') in ['true', 'True', '1', True]
}, },
'bedelia': { 'bedelia': {
'unassigned_commissions_tomorrow': unassigned_commissions_tomorrow if 'unassigned_commissions_tomorrow' in locals() else [],
'unassigned_commissions_week': unassigned_commissions_week, 'unassigned_commissions_week': unassigned_commissions_week,
'unassigned_commissions_month': unassigned_commissions_month, 'unassigned_commissions_month': unassigned_commissions_month,
'unassigned_commissions_general': unassigned_commissions_general, 'unassigned_commissions_general': unassigned_commissions_general,
'available_classrooms_today': available_classrooms_today, 'available_classrooms_today': available_classrooms_today,
'available_classrooms_tomorrow': available_classrooms_tomorrow if 'available_classrooms_tomorrow' in locals() else [],
'available_classrooms_week': available_classrooms_week, 'available_classrooms_week': available_classrooms_week,
'available_classrooms_month': available_classrooms_month, 'available_classrooms_month': available_classrooms_month,
'virtual_rooms': virtual_rooms_data, 'virtual_rooms': virtual_rooms_data,
+1 -1
View File
@@ -7,7 +7,7 @@ OPENAPI_SPEC = {
"info": { "info": {
"title": "Edu-Space REST API", "title": "Edu-Space REST API",
"description": "Enterprise Academic & Physical Space Management REST API with JWT Authentication and Role-Based Access Control.", "description": "Enterprise Academic & Physical Space Management REST API with JWT Authentication and Role-Based Access Control.",
"version": "3.4.3" "version": "3.4.4"
}, },
"servers": [ "servers": [
{ {
+1 -1
View File
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup( setup(
name="edu-space-admin", name="edu-space-admin",
version="3.4.3", version="3.4.4",
description="Administrative interface for Edu-Space Classroom Management System", description="Administrative interface for Edu-Space Classroom Management System",
author="Edu-Space Development Team", author="Edu-Space Development Team",
author_email="admin@edu-space.com", author_email="admin@edu-space.com",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "frontend", "name": "frontend",
"version": "3.4.3", "version": "3.4.4",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
+3 -3
View File
@@ -85,9 +85,9 @@ const env = nunjucks.configure(path.join(__dirname, '../views'), {
}); });
// Versiones institucionales del sistema // Versiones institucionales del sistema
const APP_VERSION = '3.4.3'; const APP_VERSION = '3.4.4';
const FRONTEND_VERSION = '3.4.3'; const FRONTEND_VERSION = '3.4.4';
const BACKEND_VERSION = '3.4.3'; const BACKEND_VERSION = '3.4.4';
env.addGlobal('app_version', APP_VERSION); env.addGlobal('app_version', APP_VERSION);
env.addGlobal('frontend_version', FRONTEND_VERSION); env.addGlobal('frontend_version', FRONTEND_VERSION);
+4
View File
@@ -123,17 +123,21 @@ router.get('/', async (req, res) => {
] ]
}; };
} else if (role === 'bedelia') { } else if (role === 'bedelia') {
const apiTomorrowSchedule = Array.isArray(apiData.tomorrow_schedule_list) ? apiData.tomorrow_schedule_list : [];
const apiWeekSchedule = Array.isArray(apiData.week_schedule_list) ? apiData.week_schedule_list : []; const apiWeekSchedule = Array.isArray(apiData.week_schedule_list) ? apiData.week_schedule_list : [];
role_data = { role_data = {
filter_stats, filter_stats,
date_labels, date_labels,
pending_reservations: apiPending || [], pending_reservations: apiPending || [],
today_schedule_list: apiTodaySchedule || [], today_schedule_list: apiTodaySchedule || [],
tomorrow_schedule_list: apiTomorrowSchedule,
week_schedule_list: apiWeekSchedule, week_schedule_list: apiWeekSchedule,
unassigned_commissions_tomorrow: bedeliaData.unassigned_commissions_tomorrow || [],
unassigned_commissions_week: bedeliaData.unassigned_commissions_week || [], unassigned_commissions_week: bedeliaData.unassigned_commissions_week || [],
unassigned_commissions_month: bedeliaData.unassigned_commissions_month || [], unassigned_commissions_month: bedeliaData.unassigned_commissions_month || [],
unassigned_commissions_general: bedeliaData.unassigned_commissions_general || [], unassigned_commissions_general: bedeliaData.unassigned_commissions_general || [],
available_classrooms_today: bedeliaData.available_classrooms_today || [], available_classrooms_today: bedeliaData.available_classrooms_today || [],
available_classrooms_tomorrow: bedeliaData.available_classrooms_tomorrow || [],
available_classrooms_week: bedeliaData.available_classrooms_week || [], available_classrooms_week: bedeliaData.available_classrooms_week || [],
available_classrooms_month: bedeliaData.available_classrooms_month || [], available_classrooms_month: bedeliaData.available_classrooms_month || [],
virtual_rooms: virtual_rooms_list, virtual_rooms: virtual_rooms_list,
+3
View File
@@ -107,6 +107,9 @@
<button type="button" class="btn btn-outline-primary active" data-period="today" onclick="switchAdminPercentiles('today')"> <button type="button" class="btn btn-outline-primary active" data-period="today" onclick="switchAdminPercentiles('today')">
<i class="bi bi-calendar-day me-1"></i>Día (Hoy) <i class="bi bi-calendar-day me-1"></i>Día (Hoy)
</button> </button>
<button type="button" class="btn btn-outline-primary" data-period="tomorrow" onclick="switchAdminPercentiles('tomorrow')">
<i class="bi bi-calendar-event me-1"></i>Mañana
</button>
<button type="button" class="btn btn-outline-primary" data-period="week" onclick="switchAdminPercentiles('week')"> <button type="button" class="btn btn-outline-primary" data-period="week" onclick="switchAdminPercentiles('week')">
<i class="bi bi-calendar-week me-1"></i>Semana <i class="bi bi-calendar-week me-1"></i>Semana
</button> </button>
+254 -4
View File
@@ -109,6 +109,9 @@
<button type="button" class="btn btn-outline-primary active" data-period="today" onclick="switchBedeliaPercentiles('today')"> <button type="button" class="btn btn-outline-primary active" data-period="today" onclick="switchBedeliaPercentiles('today')">
<i class="bi bi-calendar-day me-1"></i>Día (Hoy) <i class="bi bi-calendar-day me-1"></i>Día (Hoy)
</button> </button>
<button type="button" class="btn btn-outline-primary" data-period="tomorrow" onclick="switchBedeliaPercentiles('tomorrow')">
<i class="bi bi-calendar-plus me-1"></i>Mañana
</button>
<button type="button" class="btn btn-outline-primary" data-period="week" onclick="switchBedeliaPercentiles('week')"> <button type="button" class="btn btn-outline-primary" data-period="week" onclick="switchBedeliaPercentiles('week')">
<i class="bi bi-calendar-week me-1"></i>Semana <i class="bi bi-calendar-week me-1"></i>Semana
</button> </button>
@@ -223,6 +226,10 @@
<i class="bi bi-calendar-day me-1"></i>Clases de Hoy <i class="bi bi-calendar-day me-1"></i>Clases de Hoy
<span class="badge bg-primary ms-1" id="bedeliaTodayBadge">{{ role_data.today_schedule_list | length }}</span> <span class="badge bg-primary ms-1" id="bedeliaTodayBadge">{{ role_data.today_schedule_list | length }}</span>
</button> </button>
<button type="button" class="btn btn-outline-primary" data-view="tomorrow" onclick="switchBedeliaScheduleView('tomorrow')">
<i class="bi bi-calendar-plus me-1"></i>Mañana
<span class="badge bg-primary ms-1" id="bedeliaTomorrowBadge">{{ role_data.tomorrow_schedule_list | length if role_data.tomorrow_schedule_list else 0 }}</span>
</button>
<button type="button" class="btn btn-outline-primary" data-view="week" onclick="switchBedeliaScheduleView('week')"> <button type="button" class="btn btn-outline-primary" data-view="week" onclick="switchBedeliaScheduleView('week')">
<i class="bi bi-calendar-week me-1"></i>Esta Semana <i class="bi bi-calendar-week me-1"></i>Esta Semana
<span class="badge bg-primary ms-1" id="bedeliaWeekBadge">{{ role_data.week_schedule_list | length }}</span> <span class="badge bg-primary ms-1" id="bedeliaWeekBadge">{{ role_data.week_schedule_list | length }}</span>
@@ -306,6 +313,75 @@
{% endif %} {% endif %}
</div> </div>
<!-- Tabla Clases de Mañana -->
<div id="bedeliaScheduleTomorrow" style="display: none;">
{% if role_data.tomorrow_schedule_list and role_data.tomorrow_schedule_list | length > 0 %}
<div class="table-responsive">
<table class="table table-hover align-middle mb-0 small">
<thead class="table-light">
<tr>
<th class="ps-3">Horario</th>
<th>Aula / Espacio</th>
<th>Asignatura</th>
<th>Comisión / Turno</th>
<th>Docente</th>
<th class="text-center">Estado</th>
<th class="text-end pe-3">Acción</th>
</tr>
</thead>
<tbody>
{% for r in role_data.tomorrow_schedule_list %}
<tr>
<td class="ps-3 font-monospace">
<strong>{{ r.start_time }}</strong> - {{ r.end_time }} hs
</td>
<td>
{% if r.classroom.is_virtual %}
<span class="badge bg-info-subtle text-info border">
<i class="bi bi-camera-video me-1"></i>{{ r.classroom.code }}
</span>
{% if r.virtual_link %}
<a href="{{ r.virtual_link }}" target="_blank" class="btn btn-xs btn-outline-info ms-1 py-0 px-1" title="Unirse a videoconferencia">
<i class="bi bi-box-arrow-up-right"></i> Link
</a>
{% endif %}
{% else %}
<span class="badge bg-primary-subtle text-primary border font-monospace">
<i class="bi bi-door-open me-1"></i>{{ r.classroom.code }}
</span>
{% endif %}
</td>
<td>
<div class="fw-semibold text-body">{{ r.subject_name }}</div>
{% if r.subject_code %}<small class="text-muted font-monospace">{{ r.subject_code }}</small>{% endif %}
</td>
<td>
<span class="badge bg-secondary-subtle text-secondary border me-1">{{ r.commission.code }}</span>
<span class="badge bg-light text-dark border">{{ r.shift }}</span>
</td>
<td class="small">{{ r.user.name }}</td>
<td class="text-center">
<span class="badge bg-success-subtle text-success border">Confirmada</span>
</td>
<td class="text-end pe-3">
<a href="/schedule/today_schedule" class="btn btn-sm btn-outline-primary py-0 px-2" title="Ver en cartelera">
<i class="bi bi-eye me-1"></i>Ver
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="text-center py-4">
<i class="bi bi-calendar-x text-muted fs-1 d-block mb-2"></i>
<h6 class="text-secondary fw-bold">No hay clases programadas para el día de mañana</h6>
<p class="text-muted small mb-0">Consulte el cronograma semanal o cargue una nueva reserva si corresponde.</p>
</div>
{% endif %}
</div>
<!-- Tabla Agenda Semanal --> <!-- Tabla Agenda Semanal -->
<div id="bedeliaScheduleWeek" style="display: none;"> <div id="bedeliaScheduleWeek" style="display: none;">
{% if role_data.week_schedule_list and role_data.week_schedule_list | length > 0 %} {% if role_data.week_schedule_list and role_data.week_schedule_list | length > 0 %}
@@ -383,11 +459,14 @@
</div> </div>
</div> </div>
<div class="d-flex gap-2 align-items-center flex-wrap"> <div class="d-flex gap-2 align-items-center flex-wrap">
<!-- Selector de período: Día (Hoy por defecto), Semana, Mes --> <!-- Selector de período: Día (Hoy por defecto), Mañana, Semana, Mes -->
<div class="btn-group btn-group-sm" role="group" id="commFilterPeriodSwitcher"> <div class="btn-group btn-group-sm" role="group" id="commFilterPeriodSwitcher">
<button type="button" class="btn btn-outline-primary active" data-period="today" onclick="switchCommFilterPeriod('today')"> <button type="button" class="btn btn-outline-primary active" data-period="today" onclick="switchCommFilterPeriod('today')">
<i class="bi bi-calendar-day me-1"></i>Día (Hoy) <i class="bi bi-calendar-day me-1"></i>Día (Hoy)
</button> </button>
<button type="button" class="btn btn-outline-primary" data-period="tomorrow" onclick="switchCommFilterPeriod('tomorrow')">
<i class="bi bi-calendar-plus me-1"></i>Mañana
</button>
<button type="button" class="btn btn-outline-primary" data-period="week" onclick="switchCommFilterPeriod('week')"> <button type="button" class="btn btn-outline-primary" data-period="week" onclick="switchCommFilterPeriod('week')">
<i class="bi bi-calendar-week me-1"></i>Semana <i class="bi bi-calendar-week me-1"></i>Semana
</button> </button>
@@ -527,7 +606,109 @@
{% endif %} {% endif %}
</div> </div>
<!-- 2. SEMANA: Sin Asignar --> <!-- 2. MAÑANA: Sin Asignar -->
<div id="commBlock-tomorrow-unassigned" class="comm-block" style="display: none;">
{% if filter_stats.tomorrow.commissions.unassigned and filter_stats.tomorrow.commissions.unassigned | length > 0 %}
<div class="table-responsive">
<table class="table table-hover align-middle mb-0 small">
<thead class="table-light">
<tr>
<th class="ps-3">Comisión</th>
<th>Asignatura</th>
<th>Docente</th>
<th>Horario Habitual</th>
<th>Turno</th>
<th>Cupo</th>
<th class="text-end pe-3">Acción</th>
</tr>
</thead>
<tbody>
{% for comm in filter_stats.tomorrow.commissions.unassigned %}
<tr>
<td class="ps-3 font-monospace">
<span class="badge bg-danger-subtle text-danger border font-monospace">{{ comm.full_code }}</span>
</td>
<td>
<div class="fw-semibold text-body">{{ comm.subject_name }}</div>
{% if comm.subject_code %}<small class="text-muted font-monospace">{{ comm.subject_code }}</small>{% endif %}
</td>
<td class="small">{{ comm.teacher_name }}</td>
<td><span class="badge bg-body-tertiary text-body border"><i class="bi bi-clock me-1"></i>{{ comm.schedule }}</span></td>
<td><span class="badge bg-info-subtle text-info-emphasis border">{{ comm.shift }}</span></td>
<td class="font-monospace">{{ comm.current_students }}/{{ comm.max_students }}</td>
<td class="text-end pe-3">
<a href="/schedule/add_reservation?commission_id={{ comm.id }}" class="btn btn-sm btn-outline-success py-0 px-2" title="Asignar aula mañana a esta comisión">
<i class="bi bi-plus-circle me-1"></i>Asignar Aula
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="text-center py-4">
<i class="bi bi-check-circle-fill text-success fs-1 d-block mb-2"></i>
<h6 class="text-success fw-bold">¡Todas las comisiones de mañana tienen aula asignada!</h6>
<p class="text-muted small mb-0">No hay comisiones huérfanas sin espacio para el día de mañana.</p>
</div>
{% endif %}
</div>
<!-- 2. MAÑANA: Asignadas -->
<div id="commBlock-tomorrow-assigned" class="comm-block" style="display: none;">
{% if filter_stats.tomorrow.commissions.assigned and filter_stats.tomorrow.commissions.assigned | length > 0 %}
<div class="table-responsive">
<table class="table table-hover align-middle mb-0 small">
<thead class="table-light">
<tr>
<th class="ps-3">Comisión</th>
<th>Asignatura</th>
<th>Aula Asignada</th>
<th>Horario de Clase</th>
<th>Docente</th>
<th>Turno</th>
<th class="text-end pe-3">Acción</th>
</tr>
</thead>
<tbody>
{% for comm in filter_stats.tomorrow.commissions.assigned %}
<tr>
<td class="ps-3 font-monospace">
<span class="badge bg-success-subtle text-success border font-monospace">{{ comm.full_code }}</span>
</td>
<td>
<div class="fw-semibold text-body">{{ comm.subject_name }}</div>
{% if comm.subject_code %}<small class="text-muted font-monospace">{{ comm.subject_code }}</small>{% endif %}
</td>
<td>
<span class="badge bg-primary-subtle text-primary border font-monospace">
<i class="bi bi-door-open me-1"></i>{{ comm.assigned_room or 'Aula Asignada' }}
</span>
</td>
<td class="font-monospace text-primary fw-bold">{{ comm.assigned_time or comm.schedule }}</td>
<td class="small">{{ comm.teacher_name }}</td>
<td><span class="badge bg-info-subtle text-info-emphasis border">{{ comm.shift }}</span></td>
<td class="text-end pe-3">
<a href="/schedule/today_schedule" class="btn btn-sm btn-outline-primary py-0 px-2" title="Ver en cartelera">
<i class="bi bi-eye me-1"></i>Ver
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="text-center py-4">
<i class="bi bi-info-circle text-muted fs-1 d-block mb-2"></i>
<h6 class="text-secondary fw-bold">No hay comisiones asignadas para el día de mañana</h6>
<p class="text-muted small mb-0">Consulte las pestañas de semana o mes para ver las asignaciones programadas.</p>
</div>
{% endif %}
</div>
<!-- 3. SEMANA: Sin Asignar -->
<div id="commBlock-week-unassigned" class="comm-block" style="display: none;"> <div id="commBlock-week-unassigned" class="comm-block" style="display: none;">
{% if filter_stats.week.commissions.unassigned and filter_stats.week.commissions.unassigned | length > 0 %} {% if filter_stats.week.commissions.unassigned and filter_stats.week.commissions.unassigned | length > 0 %}
<div class="table-responsive"> <div class="table-responsive">
@@ -740,11 +921,14 @@
</div> </div>
</div> </div>
<div class="d-flex gap-2 align-items-center flex-wrap"> <div class="d-flex gap-2 align-items-center flex-wrap">
<!-- Selector de período: Día (Hoy por defecto), Semana, Mes --> <!-- Selector de período: Día (Hoy por defecto), Mañana, Semana, Mes -->
<div class="btn-group btn-group-sm" role="group" id="classFilterPeriodSwitcher"> <div class="btn-group btn-group-sm" role="group" id="classFilterPeriodSwitcher">
<button type="button" class="btn btn-outline-success active" data-period="today" onclick="switchClassFilterPeriod('today')"> <button type="button" class="btn btn-outline-success active" data-period="today" onclick="switchClassFilterPeriod('today')">
<i class="bi bi-calendar-day me-1"></i>Día (Hoy) <i class="bi bi-calendar-day me-1"></i>Día (Hoy)
</button> </button>
<button type="button" class="btn btn-outline-success" data-period="tomorrow" onclick="switchClassFilterPeriod('tomorrow')">
<i class="bi bi-calendar-plus me-1"></i>Mañana
</button>
<button type="button" class="btn btn-outline-success" data-period="week" onclick="switchClassFilterPeriod('week')"> <button type="button" class="btn btn-outline-success" data-period="week" onclick="switchClassFilterPeriod('week')">
<i class="bi bi-calendar-week me-1"></i>Semana <i class="bi bi-calendar-week me-1"></i>Semana
</button> </button>
@@ -852,7 +1036,73 @@
{% endif %} {% endif %}
</div> </div>
<!-- 2. SEMANA: Libres --> <!-- 2. MAÑANA: Libres / Sin Asignar -->
<div id="classBlock-tomorrow-unassigned" class="class-block" style="display: none;">
{% if filter_stats.tomorrow.classrooms.unassigned and filter_stats.tomorrow.classrooms.unassigned | length > 0 %}
<div class="row g-2">
{% for aula in filter_stats.tomorrow.classrooms.unassigned %}
<div class="col-sm-6 col-md-4 col-lg-3">
<a href="/schedule/add_reservation?classroom_id={{ aula.id }}" class="text-decoration-none text-reset d-block h-100">
<div class="p-3 rounded border h-100 transition-all bg-success bg-opacity-10 border-success-subtle hover-shadow">
<div class="d-flex justify-content-between align-items-start mb-2">
<span class="badge bg-success text-white border font-monospace fw-bold">{{ aula.code }}</span>
<span class="badge bg-success-subtle text-success border">Disponible Mañana</span>
</div>
<div class="small text-muted mb-1">
<i class="bi bi-building me-1"></i>{{ aula.building }}{% if aula.floor %} · {{ aula.floor }}{% endif %}
</div>
<div class="d-flex justify-content-between align-items-center mt-2 pt-2 border-top border-success-subtle">
<span class="small fw-semibold text-body"><i class="bi bi-people-fill me-1"></i>Cap: {{ aula.capacity }}</span>
<span class="badge bg-success text-white small"><i class="bi bi-plus-circle me-1"></i>Asignar</span>
</div>
</div>
</a>
</div>
{% endfor %}
</div>
{% else %}
<div class="text-center py-4">
<i class="bi bi-calendar-check-fill text-primary fs-1 d-block mb-2"></i>
<h6 class="text-primary fw-bold">¡Todas las aulas están ocupadas el día de mañana!</h6>
<p class="text-muted small mb-0">No hay espacios físicos disponibles para nuevas asignaciones mañana.</p>
</div>
{% endif %}
</div>
<!-- 2. MAÑANA: Asignadas / En Uso -->
<div id="classBlock-tomorrow-assigned" class="class-block" style="display: none;">
{% if filter_stats.tomorrow.classrooms.assigned and filter_stats.tomorrow.classrooms.assigned | length > 0 %}
<div class="row g-2">
{% for aula in filter_stats.tomorrow.classrooms.assigned %}
<div class="col-sm-6 col-md-4 col-lg-3">
<div class="p-3 rounded border h-100 bg-primary bg-opacity-10 border-primary-subtle">
<div class="d-flex justify-content-between align-items-start mb-2">
<span class="badge bg-primary text-white border font-monospace fw-bold">{{ aula.code }}</span>
<span class="badge bg-primary-subtle text-primary border">En Uso Mañana</span>
</div>
<div class="small text-muted mb-1">
<i class="bi bi-building me-1"></i>{{ aula.building }}{% if aula.floor %} · {{ aula.floor }}{% endif %}
</div>
<div class="small text-primary fw-semibold mb-2 text-truncate" title="{{ aula.assigned_summary }}">
<i class="bi bi-clock-history me-1"></i>{{ aula.assigned_summary or 'Clase activa' }}
</div>
<div class="d-flex justify-content-between align-items-center mt-2 pt-2 border-top border-primary-subtle">
<span class="small fw-semibold text-body"><i class="bi bi-people-fill me-1"></i>Cap: {{ aula.capacity }}</span>
<a href="/schedule/today_schedule" class="btn btn-xs btn-outline-primary py-0 px-2">Ver Cartelera</a>
</div>
</div>
</div>
{% endfor %}
</div>
{% else %}
<div class="text-center py-4">
<i class="bi bi-door-open text-muted fs-1 d-block mb-2"></i>
<h6 class="text-secondary fw-bold">No hay aulas en uso el día de mañana</h6>
</div>
{% endif %}
</div>
<!-- 3. SEMANA: Libres -->
<div id="classBlock-week-unassigned" class="class-block" style="display: none;"> <div id="classBlock-week-unassigned" class="class-block" style="display: none;">
{% if filter_stats.week.classrooms.unassigned and filter_stats.week.classrooms.unassigned | length > 0 %} {% if filter_stats.week.classrooms.unassigned and filter_stats.week.classrooms.unassigned | length > 0 %}
<div class="row g-2"> <div class="row g-2">
+7 -5
View File
@@ -172,8 +172,10 @@ document.querySelectorAll('[data-color]').forEach(function(el) {
// Bedelía: Switcher para Cartelera y Agenda de Clases // Bedelía: Switcher para Cartelera y Agenda de Clases
function switchBedeliaScheduleView(view) { function switchBedeliaScheduleView(view) {
const todayEl = document.getElementById('bedeliaScheduleToday'); const todayEl = document.getElementById('bedeliaScheduleToday');
const tomorrowEl = document.getElementById('bedeliaScheduleTomorrow');
const weekEl = document.getElementById('bedeliaScheduleWeek'); const weekEl = document.getElementById('bedeliaScheduleWeek');
if (todayEl) todayEl.style.display = view === 'today' ? 'block' : 'none'; if (todayEl) todayEl.style.display = view === 'today' ? 'block' : 'none';
if (tomorrowEl) tomorrowEl.style.display = view === 'tomorrow' ? 'block' : 'none';
if (weekEl) weekEl.style.display = view === 'week' ? 'block' : 'none'; if (weekEl) weekEl.style.display = view === 'week' ? 'block' : 'none';
document.querySelectorAll('#bedeliaScheduleSwitcher button').forEach(function(btn) { document.querySelectorAll('#bedeliaScheduleSwitcher button').forEach(function(btn) {
btn.classList.toggle('active', btn.getAttribute('data-view') === view); btn.classList.toggle('active', btn.getAttribute('data-view') === view);
@@ -197,7 +199,7 @@ let currentCommStatus = 'unassigned';
let currentClassPeriod = 'today'; let currentClassPeriod = 'today';
let currentClassStatus = 'unassigned'; let currentClassStatus = 'unassigned';
// Bedelía: Switcher de Percentiles de Aulas (Día / Semana / Mes) // Bedelía: Switcher de Percentiles de Aulas (Día / Mañana / Semana / Mes)
function switchBedeliaPercentiles(period) { function switchBedeliaPercentiles(period) {
if (!FILTER_STATS_DATA || !FILTER_STATS_DATA[period]) return; if (!FILTER_STATS_DATA || !FILTER_STATS_DATA[period]) return;
const periodData = FILTER_STATS_DATA[period]; const periodData = FILTER_STATS_DATA[period];
@@ -208,7 +210,7 @@ function switchBedeliaPercentiles(period) {
const periodTitle = document.getElementById('bedeliaPctPeriodTitle'); const periodTitle = document.getElementById('bedeliaPctPeriodTitle');
if (periodTitle) { if (periodTitle) {
periodTitle.innerText = period === 'today' ? 'Día (Hoy)' : (period === 'week' ? 'Semana' : 'Mes'); periodTitle.innerText = period === 'today' ? 'Día (Hoy)' : (period === 'tomorrow' ? 'Mañana' : (period === 'week' ? 'Semana' : 'Mes'));
} }
const assignedCount = document.getElementById('bedeliaPctAssignedCount'); const assignedCount = document.getElementById('bedeliaPctAssignedCount');
@@ -222,7 +224,7 @@ function switchBedeliaPercentiles(period) {
if (unassignedCount) unassignedCount.innerText = classData.unassigned_count ?? 0; if (unassignedCount) unassignedCount.innerText = classData.unassigned_count ?? 0;
if (unassignedPct) unassignedPct.innerText = (classData.unassigned_pct ?? 0) + '%'; if (unassignedPct) unassignedPct.innerText = (classData.unassigned_pct ?? 0) + '%';
if (assignedLabel) { if (assignedLabel) {
assignedLabel.innerText = period === 'today' ? 'Con cursada activa hoy' : (period === 'week' ? 'Con cursada activa esta semana' : 'Con cursada activa este mes'); assignedLabel.innerText = period === 'today' ? 'Con cursada activa hoy' : (period === 'tomorrow' ? 'Con cursada activa mañana' : (period === 'week' ? 'Con cursada activa esta semana' : 'Con cursada activa este mes'));
} }
// Actualizar leyendas y barras // Actualizar leyendas y barras
@@ -254,7 +256,7 @@ function switchBedeliaPercentiles(period) {
}); });
} }
// Admin: Switcher de Percentiles de Aulas (Día / Semana / Mes) // Admin: Switcher de Percentiles de Aulas (Día / Mañana / Semana / Mes)
function switchAdminPercentiles(period) { function switchAdminPercentiles(period) {
if (!FILTER_STATS_DATA || !FILTER_STATS_DATA[period]) return; if (!FILTER_STATS_DATA || !FILTER_STATS_DATA[period]) return;
const periodData = FILTER_STATS_DATA[period]; const periodData = FILTER_STATS_DATA[period];
@@ -265,7 +267,7 @@ function switchAdminPercentiles(period) {
const periodTitle = document.getElementById('adminPctPeriodTitle'); const periodTitle = document.getElementById('adminPctPeriodTitle');
if (periodTitle) { if (periodTitle) {
periodTitle.innerText = period === 'today' ? 'Día (Hoy)' : (period === 'week' ? 'Semana' : 'Mes'); periodTitle.innerText = period === 'today' ? 'Día (Hoy)' : (period === 'tomorrow' ? 'Mañana' : (period === 'week' ? 'Semana' : 'Mes'));
} }
const assignedCount = document.getElementById('adminPctAssignedCount'); const assignedCount = document.getElementById('adminPctAssignedCount');
+3
View File
@@ -107,6 +107,9 @@
<button type="button" class="btn btn-outline-primary active" data-period="today" onclick="switchAdminPercentiles('today')"> <button type="button" class="btn btn-outline-primary active" data-period="today" onclick="switchAdminPercentiles('today')">
<i class="bi bi-calendar-day me-1"></i>Día (Hoy) <i class="bi bi-calendar-day me-1"></i>Día (Hoy)
</button> </button>
<button type="button" class="btn btn-outline-primary" data-period="tomorrow" onclick="switchAdminPercentiles('tomorrow')">
<i class="bi bi-calendar-event me-1"></i>Mañana
</button>
<button type="button" class="btn btn-outline-primary" data-period="week" onclick="switchAdminPercentiles('week')"> <button type="button" class="btn btn-outline-primary" data-period="week" onclick="switchAdminPercentiles('week')">
<i class="bi bi-calendar-week me-1"></i>Semana <i class="bi bi-calendar-week me-1"></i>Semana
</button> </button>
+254 -4
View File
@@ -109,6 +109,9 @@
<button type="button" class="btn btn-outline-primary active" data-period="today" onclick="switchBedeliaPercentiles('today')"> <button type="button" class="btn btn-outline-primary active" data-period="today" onclick="switchBedeliaPercentiles('today')">
<i class="bi bi-calendar-day me-1"></i>Día (Hoy) <i class="bi bi-calendar-day me-1"></i>Día (Hoy)
</button> </button>
<button type="button" class="btn btn-outline-primary" data-period="tomorrow" onclick="switchBedeliaPercentiles('tomorrow')">
<i class="bi bi-calendar-plus me-1"></i>Mañana
</button>
<button type="button" class="btn btn-outline-primary" data-period="week" onclick="switchBedeliaPercentiles('week')"> <button type="button" class="btn btn-outline-primary" data-period="week" onclick="switchBedeliaPercentiles('week')">
<i class="bi bi-calendar-week me-1"></i>Semana <i class="bi bi-calendar-week me-1"></i>Semana
</button> </button>
@@ -223,6 +226,10 @@
<i class="bi bi-calendar-day me-1"></i>Clases de Hoy <i class="bi bi-calendar-day me-1"></i>Clases de Hoy
<span class="badge bg-primary ms-1" id="bedeliaTodayBadge">{{ role_data.today_schedule_list | length }}</span> <span class="badge bg-primary ms-1" id="bedeliaTodayBadge">{{ role_data.today_schedule_list | length }}</span>
</button> </button>
<button type="button" class="btn btn-outline-primary" data-view="tomorrow" onclick="switchBedeliaScheduleView('tomorrow')">
<i class="bi bi-calendar-plus me-1"></i>Mañana
<span class="badge bg-primary ms-1" id="bedeliaTomorrowBadge">{{ role_data.tomorrow_schedule_list | length if role_data.tomorrow_schedule_list else 0 }}</span>
</button>
<button type="button" class="btn btn-outline-primary" data-view="week" onclick="switchBedeliaScheduleView('week')"> <button type="button" class="btn btn-outline-primary" data-view="week" onclick="switchBedeliaScheduleView('week')">
<i class="bi bi-calendar-week me-1"></i>Esta Semana <i class="bi bi-calendar-week me-1"></i>Esta Semana
<span class="badge bg-primary ms-1" id="bedeliaWeekBadge">{{ role_data.week_schedule_list | length }}</span> <span class="badge bg-primary ms-1" id="bedeliaWeekBadge">{{ role_data.week_schedule_list | length }}</span>
@@ -306,6 +313,75 @@
{% endif %} {% endif %}
</div> </div>
<!-- Tabla Clases de Mañana -->
<div id="bedeliaScheduleTomorrow" style="display: none;">
{% if role_data.tomorrow_schedule_list and role_data.tomorrow_schedule_list | length > 0 %}
<div class="table-responsive">
<table class="table table-hover align-middle mb-0 small">
<thead class="table-light">
<tr>
<th class="ps-3">Horario</th>
<th>Aula / Espacio</th>
<th>Asignatura</th>
<th>Comisión / Turno</th>
<th>Docente</th>
<th class="text-center">Estado</th>
<th class="text-end pe-3">Acción</th>
</tr>
</thead>
<tbody>
{% for r in role_data.tomorrow_schedule_list %}
<tr>
<td class="ps-3 font-monospace">
<strong>{{ r.start_time }}</strong> - {{ r.end_time }} hs
</td>
<td>
{% if r.classroom.is_virtual %}
<span class="badge bg-info-subtle text-info border">
<i class="bi bi-camera-video me-1"></i>{{ r.classroom.code }}
</span>
{% if r.virtual_link %}
<a href="{{ r.virtual_link }}" target="_blank" class="btn btn-xs btn-outline-info ms-1 py-0 px-1" title="Unirse a videoconferencia">
<i class="bi bi-box-arrow-up-right"></i> Link
</a>
{% endif %}
{% else %}
<span class="badge bg-primary-subtle text-primary border font-monospace">
<i class="bi bi-door-open me-1"></i>{{ r.classroom.code }}
</span>
{% endif %}
</td>
<td>
<div class="fw-semibold text-body">{{ r.subject_name }}</div>
{% if r.subject_code %}<small class="text-muted font-monospace">{{ r.subject_code }}</small>{% endif %}
</td>
<td>
<span class="badge bg-secondary-subtle text-secondary border me-1">{{ r.commission.code }}</span>
<span class="badge bg-light text-dark border">{{ r.shift }}</span>
</td>
<td class="small">{{ r.user.name }}</td>
<td class="text-center">
<span class="badge bg-success-subtle text-success border">Confirmada</span>
</td>
<td class="text-end pe-3">
<a href="/schedule/today_schedule" class="btn btn-sm btn-outline-primary py-0 px-2" title="Ver en cartelera">
<i class="bi bi-eye me-1"></i>Ver
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="text-center py-4">
<i class="bi bi-calendar-x text-muted fs-1 d-block mb-2"></i>
<h6 class="text-secondary fw-bold">No hay clases programadas para el día de mañana</h6>
<p class="text-muted small mb-0">Consulte el cronograma semanal o cargue una nueva reserva si corresponde.</p>
</div>
{% endif %}
</div>
<!-- Tabla Agenda Semanal --> <!-- Tabla Agenda Semanal -->
<div id="bedeliaScheduleWeek" style="display: none;"> <div id="bedeliaScheduleWeek" style="display: none;">
{% if role_data.week_schedule_list and role_data.week_schedule_list | length > 0 %} {% if role_data.week_schedule_list and role_data.week_schedule_list | length > 0 %}
@@ -383,11 +459,14 @@
</div> </div>
</div> </div>
<div class="d-flex gap-2 align-items-center flex-wrap"> <div class="d-flex gap-2 align-items-center flex-wrap">
<!-- Selector de período: Día (Hoy por defecto), Semana, Mes --> <!-- Selector de período: Día (Hoy por defecto), Mañana, Semana, Mes -->
<div class="btn-group btn-group-sm" role="group" id="commFilterPeriodSwitcher"> <div class="btn-group btn-group-sm" role="group" id="commFilterPeriodSwitcher">
<button type="button" class="btn btn-outline-primary active" data-period="today" onclick="switchCommFilterPeriod('today')"> <button type="button" class="btn btn-outline-primary active" data-period="today" onclick="switchCommFilterPeriod('today')">
<i class="bi bi-calendar-day me-1"></i>Día (Hoy) <i class="bi bi-calendar-day me-1"></i>Día (Hoy)
</button> </button>
<button type="button" class="btn btn-outline-primary" data-period="tomorrow" onclick="switchCommFilterPeriod('tomorrow')">
<i class="bi bi-calendar-plus me-1"></i>Mañana
</button>
<button type="button" class="btn btn-outline-primary" data-period="week" onclick="switchCommFilterPeriod('week')"> <button type="button" class="btn btn-outline-primary" data-period="week" onclick="switchCommFilterPeriod('week')">
<i class="bi bi-calendar-week me-1"></i>Semana <i class="bi bi-calendar-week me-1"></i>Semana
</button> </button>
@@ -527,7 +606,109 @@
{% endif %} {% endif %}
</div> </div>
<!-- 2. SEMANA: Sin Asignar --> <!-- 2. MAÑANA: Sin Asignar -->
<div id="commBlock-tomorrow-unassigned" class="comm-block" style="display: none;">
{% if filter_stats.tomorrow.commissions.unassigned and filter_stats.tomorrow.commissions.unassigned | length > 0 %}
<div class="table-responsive">
<table class="table table-hover align-middle mb-0 small">
<thead class="table-light">
<tr>
<th class="ps-3">Comisión</th>
<th>Asignatura</th>
<th>Docente</th>
<th>Horario Habitual</th>
<th>Turno</th>
<th>Cupo</th>
<th class="text-end pe-3">Acción</th>
</tr>
</thead>
<tbody>
{% for comm in filter_stats.tomorrow.commissions.unassigned %}
<tr>
<td class="ps-3 font-monospace">
<span class="badge bg-danger-subtle text-danger border font-monospace">{{ comm.full_code }}</span>
</td>
<td>
<div class="fw-semibold text-body">{{ comm.subject_name }}</div>
{% if comm.subject_code %}<small class="text-muted font-monospace">{{ comm.subject_code }}</small>{% endif %}
</td>
<td class="small">{{ comm.teacher_name }}</td>
<td><span class="badge bg-body-tertiary text-body border"><i class="bi bi-clock me-1"></i>{{ comm.schedule }}</span></td>
<td><span class="badge bg-info-subtle text-info-emphasis border">{{ comm.shift }}</span></td>
<td class="font-monospace">{{ comm.current_students }}/{{ comm.max_students }}</td>
<td class="text-end pe-3">
<a href="/schedule/add_reservation?commission_id={{ comm.id }}" class="btn btn-sm btn-outline-success py-0 px-2" title="Asignar aula mañana a esta comisión">
<i class="bi bi-plus-circle me-1"></i>Asignar Aula
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="text-center py-4">
<i class="bi bi-check-circle-fill text-success fs-1 d-block mb-2"></i>
<h6 class="text-success fw-bold">¡Todas las comisiones de mañana tienen aula asignada!</h6>
<p class="text-muted small mb-0">No hay comisiones huérfanas sin espacio para el día de mañana.</p>
</div>
{% endif %}
</div>
<!-- 2. MAÑANA: Asignadas -->
<div id="commBlock-tomorrow-assigned" class="comm-block" style="display: none;">
{% if filter_stats.tomorrow.commissions.assigned and filter_stats.tomorrow.commissions.assigned | length > 0 %}
<div class="table-responsive">
<table class="table table-hover align-middle mb-0 small">
<thead class="table-light">
<tr>
<th class="ps-3">Comisión</th>
<th>Asignatura</th>
<th>Aula Asignada</th>
<th>Horario de Clase</th>
<th>Docente</th>
<th>Turno</th>
<th class="text-end pe-3">Acción</th>
</tr>
</thead>
<tbody>
{% for comm in filter_stats.tomorrow.commissions.assigned %}
<tr>
<td class="ps-3 font-monospace">
<span class="badge bg-success-subtle text-success border font-monospace">{{ comm.full_code }}</span>
</td>
<td>
<div class="fw-semibold text-body">{{ comm.subject_name }}</div>
{% if comm.subject_code %}<small class="text-muted font-monospace">{{ comm.subject_code }}</small>{% endif %}
</td>
<td>
<span class="badge bg-primary-subtle text-primary border font-monospace">
<i class="bi bi-door-open me-1"></i>{{ comm.assigned_room or 'Aula Asignada' }}
</span>
</td>
<td class="font-monospace text-primary fw-bold">{{ comm.assigned_time or comm.schedule }}</td>
<td class="small">{{ comm.teacher_name }}</td>
<td><span class="badge bg-info-subtle text-info-emphasis border">{{ comm.shift }}</span></td>
<td class="text-end pe-3">
<a href="/schedule/today_schedule" class="btn btn-sm btn-outline-primary py-0 px-2" title="Ver en cartelera">
<i class="bi bi-eye me-1"></i>Ver
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="text-center py-4">
<i class="bi bi-info-circle text-muted fs-1 d-block mb-2"></i>
<h6 class="text-secondary fw-bold">No hay comisiones asignadas para el día de mañana</h6>
<p class="text-muted small mb-0">Consulte las pestañas de semana o mes para ver las asignaciones programadas.</p>
</div>
{% endif %}
</div>
<!-- 3. SEMANA: Sin Asignar -->
<div id="commBlock-week-unassigned" class="comm-block" style="display: none;"> <div id="commBlock-week-unassigned" class="comm-block" style="display: none;">
{% if filter_stats.week.commissions.unassigned and filter_stats.week.commissions.unassigned | length > 0 %} {% if filter_stats.week.commissions.unassigned and filter_stats.week.commissions.unassigned | length > 0 %}
<div class="table-responsive"> <div class="table-responsive">
@@ -740,11 +921,14 @@
</div> </div>
</div> </div>
<div class="d-flex gap-2 align-items-center flex-wrap"> <div class="d-flex gap-2 align-items-center flex-wrap">
<!-- Selector de período: Día (Hoy por defecto), Semana, Mes --> <!-- Selector de período: Día (Hoy por defecto), Mañana, Semana, Mes -->
<div class="btn-group btn-group-sm" role="group" id="classFilterPeriodSwitcher"> <div class="btn-group btn-group-sm" role="group" id="classFilterPeriodSwitcher">
<button type="button" class="btn btn-outline-success active" data-period="today" onclick="switchClassFilterPeriod('today')"> <button type="button" class="btn btn-outline-success active" data-period="today" onclick="switchClassFilterPeriod('today')">
<i class="bi bi-calendar-day me-1"></i>Día (Hoy) <i class="bi bi-calendar-day me-1"></i>Día (Hoy)
</button> </button>
<button type="button" class="btn btn-outline-success" data-period="tomorrow" onclick="switchClassFilterPeriod('tomorrow')">
<i class="bi bi-calendar-plus me-1"></i>Mañana
</button>
<button type="button" class="btn btn-outline-success" data-period="week" onclick="switchClassFilterPeriod('week')"> <button type="button" class="btn btn-outline-success" data-period="week" onclick="switchClassFilterPeriod('week')">
<i class="bi bi-calendar-week me-1"></i>Semana <i class="bi bi-calendar-week me-1"></i>Semana
</button> </button>
@@ -852,7 +1036,73 @@
{% endif %} {% endif %}
</div> </div>
<!-- 2. SEMANA: Libres --> <!-- 2. MAÑANA: Libres / Sin Asignar -->
<div id="classBlock-tomorrow-unassigned" class="class-block" style="display: none;">
{% if filter_stats.tomorrow.classrooms.unassigned and filter_stats.tomorrow.classrooms.unassigned | length > 0 %}
<div class="row g-2">
{% for aula in filter_stats.tomorrow.classrooms.unassigned %}
<div class="col-sm-6 col-md-4 col-lg-3">
<a href="/schedule/add_reservation?classroom_id={{ aula.id }}" class="text-decoration-none text-reset d-block h-100">
<div class="p-3 rounded border h-100 transition-all bg-success bg-opacity-10 border-success-subtle hover-shadow">
<div class="d-flex justify-content-between align-items-start mb-2">
<span class="badge bg-success text-white border font-monospace fw-bold">{{ aula.code }}</span>
<span class="badge bg-success-subtle text-success border">Disponible Mañana</span>
</div>
<div class="small text-muted mb-1">
<i class="bi bi-building me-1"></i>{{ aula.building }}{% if aula.floor %} · {{ aula.floor }}{% endif %}
</div>
<div class="d-flex justify-content-between align-items-center mt-2 pt-2 border-top border-success-subtle">
<span class="small fw-semibold text-body"><i class="bi bi-people-fill me-1"></i>Cap: {{ aula.capacity }}</span>
<span class="badge bg-success text-white small"><i class="bi bi-plus-circle me-1"></i>Asignar</span>
</div>
</div>
</a>
</div>
{% endfor %}
</div>
{% else %}
<div class="text-center py-4">
<i class="bi bi-calendar-check-fill text-primary fs-1 d-block mb-2"></i>
<h6 class="text-primary fw-bold">¡Todas las aulas están ocupadas el día de mañana!</h6>
<p class="text-muted small mb-0">No hay espacios físicos disponibles para nuevas asignaciones mañana.</p>
</div>
{% endif %}
</div>
<!-- 2. MAÑANA: Asignadas / En Uso -->
<div id="classBlock-tomorrow-assigned" class="class-block" style="display: none;">
{% if filter_stats.tomorrow.classrooms.assigned and filter_stats.tomorrow.classrooms.assigned | length > 0 %}
<div class="row g-2">
{% for aula in filter_stats.tomorrow.classrooms.assigned %}
<div class="col-sm-6 col-md-4 col-lg-3">
<div class="p-3 rounded border h-100 bg-primary bg-opacity-10 border-primary-subtle">
<div class="d-flex justify-content-between align-items-start mb-2">
<span class="badge bg-primary text-white border font-monospace fw-bold">{{ aula.code }}</span>
<span class="badge bg-primary-subtle text-primary border">En Uso Mañana</span>
</div>
<div class="small text-muted mb-1">
<i class="bi bi-building me-1"></i>{{ aula.building }}{% if aula.floor %} · {{ aula.floor }}{% endif %}
</div>
<div class="small text-primary fw-semibold mb-2 text-truncate" title="{{ aula.assigned_summary }}">
<i class="bi bi-clock-history me-1"></i>{{ aula.assigned_summary or 'Clase activa' }}
</div>
<div class="d-flex justify-content-between align-items-center mt-2 pt-2 border-top border-primary-subtle">
<span class="small fw-semibold text-body"><i class="bi bi-people-fill me-1"></i>Cap: {{ aula.capacity }}</span>
<a href="/schedule/today_schedule" class="btn btn-xs btn-outline-primary py-0 px-2">Ver Cartelera</a>
</div>
</div>
</div>
{% endfor %}
</div>
{% else %}
<div class="text-center py-4">
<i class="bi bi-door-open text-muted fs-1 d-block mb-2"></i>
<h6 class="text-secondary fw-bold">No hay aulas en uso el día de mañana</h6>
</div>
{% endif %}
</div>
<!-- 3. SEMANA: Libres -->
<div id="classBlock-week-unassigned" class="class-block" style="display: none;"> <div id="classBlock-week-unassigned" class="class-block" style="display: none;">
{% if filter_stats.week.classrooms.unassigned and filter_stats.week.classrooms.unassigned | length > 0 %} {% if filter_stats.week.classrooms.unassigned and filter_stats.week.classrooms.unassigned | length > 0 %}
<div class="row g-2"> <div class="row g-2">