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
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "3.4.3",
"version": "3.4.4",
"description": "",
"main": "index.js",
"scripts": {
+3 -3
View File
@@ -85,9 +85,9 @@ const env = nunjucks.configure(path.join(__dirname, '../views'), {
});
// Versiones institucionales del sistema
const APP_VERSION = '3.4.3';
const FRONTEND_VERSION = '3.4.3';
const BACKEND_VERSION = '3.4.3';
const APP_VERSION = '3.4.4';
const FRONTEND_VERSION = '3.4.4';
const BACKEND_VERSION = '3.4.4';
env.addGlobal('app_version', APP_VERSION);
env.addGlobal('frontend_version', FRONTEND_VERSION);
+4
View File
@@ -123,17 +123,21 @@ router.get('/', async (req, res) => {
]
};
} 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 : [];
role_data = {
filter_stats,
date_labels,
pending_reservations: apiPending || [],
today_schedule_list: apiTodaySchedule || [],
tomorrow_schedule_list: apiTomorrowSchedule,
week_schedule_list: apiWeekSchedule,
unassigned_commissions_tomorrow: bedeliaData.unassigned_commissions_tomorrow || [],
unassigned_commissions_week: bedeliaData.unassigned_commissions_week || [],
unassigned_commissions_month: bedeliaData.unassigned_commissions_month || [],
unassigned_commissions_general: bedeliaData.unassigned_commissions_general || [],
available_classrooms_today: bedeliaData.available_classrooms_today || [],
available_classrooms_tomorrow: bedeliaData.available_classrooms_tomorrow || [],
available_classrooms_week: bedeliaData.available_classrooms_week || [],
available_classrooms_month: bedeliaData.available_classrooms_month || [],
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')">
<i class="bi bi-calendar-day me-1"></i>Día (Hoy)
</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')">
<i class="bi bi-calendar-week me-1"></i>Semana
</button>
+254 -4
View File
@@ -109,6 +109,9 @@
<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)
</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')">
<i class="bi bi-calendar-week me-1"></i>Semana
</button>
@@ -223,6 +226,10 @@
<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>
</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')">
<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>
@@ -306,6 +313,75 @@
{% endif %}
</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 -->
<div id="bedeliaScheduleWeek" style="display: none;">
{% if role_data.week_schedule_list and role_data.week_schedule_list | length > 0 %}
@@ -383,11 +459,14 @@
</div>
</div>
<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">
<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)
</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')">
<i class="bi bi-calendar-week me-1"></i>Semana
</button>
@@ -527,7 +606,109 @@
{% endif %}
</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;">
{% if filter_stats.week.commissions.unassigned and filter_stats.week.commissions.unassigned | length > 0 %}
<div class="table-responsive">
@@ -740,11 +921,14 @@
</div>
</div>
<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">
<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)
</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')">
<i class="bi bi-calendar-week me-1"></i>Semana
</button>
@@ -852,7 +1036,73 @@
{% endif %}
</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;">
{% if filter_stats.week.classrooms.unassigned and filter_stats.week.classrooms.unassigned | length > 0 %}
<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
function switchBedeliaScheduleView(view) {
const todayEl = document.getElementById('bedeliaScheduleToday');
const tomorrowEl = document.getElementById('bedeliaScheduleTomorrow');
const weekEl = document.getElementById('bedeliaScheduleWeek');
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';
document.querySelectorAll('#bedeliaScheduleSwitcher button').forEach(function(btn) {
btn.classList.toggle('active', btn.getAttribute('data-view') === view);
@@ -197,7 +199,7 @@ let currentCommStatus = 'unassigned';
let currentClassPeriod = 'today';
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) {
if (!FILTER_STATS_DATA || !FILTER_STATS_DATA[period]) return;
const periodData = FILTER_STATS_DATA[period];
@@ -208,7 +210,7 @@ function switchBedeliaPercentiles(period) {
const periodTitle = document.getElementById('bedeliaPctPeriodTitle');
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');
@@ -222,7 +224,7 @@ function switchBedeliaPercentiles(period) {
if (unassignedCount) unassignedCount.innerText = classData.unassigned_count ?? 0;
if (unassignedPct) unassignedPct.innerText = (classData.unassigned_pct ?? 0) + '%';
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
@@ -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) {
if (!FILTER_STATS_DATA || !FILTER_STATS_DATA[period]) return;
const periodData = FILTER_STATS_DATA[period];
@@ -265,7 +267,7 @@ function switchAdminPercentiles(period) {
const periodTitle = document.getElementById('adminPctPeriodTitle');
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');
+3
View File
@@ -107,6 +107,9 @@
<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)
</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')">
<i class="bi bi-calendar-week me-1"></i>Semana
</button>
+254 -4
View File
@@ -109,6 +109,9 @@
<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)
</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')">
<i class="bi bi-calendar-week me-1"></i>Semana
</button>
@@ -223,6 +226,10 @@
<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>
</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')">
<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>
@@ -306,6 +313,75 @@
{% endif %}
</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 -->
<div id="bedeliaScheduleWeek" style="display: none;">
{% if role_data.week_schedule_list and role_data.week_schedule_list | length > 0 %}
@@ -383,11 +459,14 @@
</div>
</div>
<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">
<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)
</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')">
<i class="bi bi-calendar-week me-1"></i>Semana
</button>
@@ -527,7 +606,109 @@
{% endif %}
</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;">
{% if filter_stats.week.commissions.unassigned and filter_stats.week.commissions.unassigned | length > 0 %}
<div class="table-responsive">
@@ -740,11 +921,14 @@
</div>
</div>
<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">
<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)
</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')">
<i class="bi bi-calendar-week me-1"></i>Semana
</button>
@@ -852,7 +1036,73 @@
{% endif %}
</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;">
{% if filter_stats.week.classrooms.unassigned and filter_stats.week.classrooms.unassigned | length > 0 %}
<div class="row g-2">