fix: update bedelia views for today and weekly reservations, available rooms and unassigned commissions
This commit is contained in:
@@ -637,6 +637,171 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ========================= Panel: Cartelera Operativa & Agenda de Clases (Hoy y Semana) ========================= -->
|
||||
<div class="card border-0 shadow-sm mb-4" id="bedelia-reservations-schedule">
|
||||
<div class="card-header bg-body-tertiary border-0 py-3 d-flex justify-content-between align-items-center flex-wrap gap-2">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<i class="bi bi-calendar-check-fill text-primary fs-5"></i>
|
||||
<div>
|
||||
<h5 class="mb-0 h6 fw-bold">Cartelera Operativa & Agenda de Clases</h5>
|
||||
<small class="text-muted">Control de reservas áulicas presenciales y virtuales activas</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex gap-2 align-items-center flex-wrap">
|
||||
<div class="btn-group btn-group-sm" role="group" id="bedeliaScheduleSwitcher">
|
||||
<button type="button" class="btn btn-outline-primary active" data-view="today" onclick="switchBedeliaScheduleView('today')">
|
||||
<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="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>
|
||||
</button>
|
||||
</div>
|
||||
<a href="/schedule/today_schedule" class="btn btn-sm btn-outline-info">
|
||||
<i class="bi bi-clock-history me-1"></i>Cartelera en Vivo
|
||||
</a>
|
||||
<a href="/schedule/calendar_view" class="btn btn-sm btn-outline-secondary">
|
||||
<i class="bi bi-calendar3 me-1"></i>Calendario Semanal
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<!-- Tabla Clases de Hoy -->
|
||||
<div id="bedeliaScheduleToday">
|
||||
{% if role_data.today_schedule_list and role_data.today_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.today_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 del día">
|
||||
<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 hoy</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 %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover align-middle mb-0 small">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="ps-3">Fecha</th>
|
||||
<th>Horario</th>
|
||||
<th>Aula / Espacio</th>
|
||||
<th>Asignatura</th>
|
||||
<th>Comisión / Turno</th>
|
||||
<th>Docente</th>
|
||||
<th class="text-end pe-3">Acción</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for r in role_data.week_schedule_list %}
|
||||
<tr>
|
||||
<td class="ps-3 font-monospace fw-bold text-primary">
|
||||
{{ r.date_display }}
|
||||
</td>
|
||||
<td class="font-monospace">
|
||||
{{ r.start_time }} - {{ 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>
|
||||
{% 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-end pe-3">
|
||||
<a href="/schedule/calendar_view" class="btn btn-sm btn-outline-secondary py-0 px-2" title="Ver en calendario">
|
||||
<i class="bi bi-calendar3 me-1"></i>Calendario
|
||||
</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 esta semana</h6>
|
||||
<p class="text-muted small mb-0">Puede importar cursadas desde Google Sheets o cargar reservas manualmente.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ========================= Panel: Comisiones Sin Reserva (Semana/Mes) ========================= -->
|
||||
<div class="card border-0 shadow-sm mb-4" id="bedelia-unassigned-commissions">
|
||||
<div class="card-header bg-body-tertiary border-0 py-3 d-flex justify-content-between align-items-center flex-wrap gap-2">
|
||||
@@ -653,6 +818,10 @@
|
||||
<i class="bi bi-calendar-week me-1"></i>Esta Semana
|
||||
<span class="badge bg-danger ms-1" id="commWeekBadge">{{ role_data.unassigned_commissions_week | length }}</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-danger" data-period="general" onclick="switchCommPeriod('general')">
|
||||
<i class="bi bi-exclamation-triangle-fill me-1"></i>Sin Aula Física ni Virtual
|
||||
<span class="badge bg-danger ms-1" id="commGeneralBadge">{{ role_data.unassigned_commissions_general | length }}</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-danger" data-period="month" onclick="switchCommPeriod('month')">
|
||||
<i class="bi bi-calendar-month me-1"></i>Este Mes
|
||||
<span class="badge bg-danger ms-1" id="commMonthBadge">{{ role_data.unassigned_commissions_month | length }}</span>
|
||||
@@ -769,12 +938,63 @@
|
||||
<h6 class="text-success fw-bold">¡Todas las comisiones tienen reserva este mes!</h6>
|
||||
<p class="text-muted small mb-0">No hay comisiones activas sin aula reservada en el mes actual.</p>
|
||||
</div>
|
||||
<!-- Tabla General (Sin Aula Presencial ni Virtual) -->
|
||||
<div id="commTableGeneral" style="display: none;">
|
||||
{% if role_data.unassigned_commissions_general and role_data.unassigned_commissions_general | 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">Código</th>
|
||||
<th>Materia</th>
|
||||
<th>Docente</th>
|
||||
<th>Horario Programado</th>
|
||||
<th>Turno</th>
|
||||
<th>Cupo</th>
|
||||
<th class="text-end pe-3">Acción</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for comm in role_data.unassigned_commissions_general %}
|
||||
<tr>
|
||||
<td class="ps-3">
|
||||
<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>
|
||||
<small class="text-muted font-monospace">{{ comm.subject_code }}</small>
|
||||
</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 a esta comisión">
|
||||
<i class="bi bi-plus-circle me-1"></i>Asignar
|
||||
</a>
|
||||
<a href="/admin/commission_detail?id={{ comm.id }}" class="btn btn-sm btn-outline-primary py-0 px-2 ms-1" title="Ver detalle">
|
||||
<i class="bi bi-eye me-1"></i>Detalle
|
||||
</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">¡Excelente! Todas las comisiones tienen aula física o virtual asignada</h6>
|
||||
<p class="text-muted small mb-0">No se detectaron comisiones huérfanas sin espacio asignado.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ========================= Panel: Aulas Disponibles (Semana/Mes) ========================= -->
|
||||
<!-- ========================= Panel: Aulas Disponibles (Hoy / Semana / Mes) ========================= -->
|
||||
<div class="card border-0 shadow-sm mb-4" id="bedelia-available-classrooms">
|
||||
<div class="card-header bg-body-tertiary border-0 py-3 d-flex justify-content-between align-items-center flex-wrap gap-2">
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
@@ -786,7 +1006,11 @@
|
||||
</div>
|
||||
<div class="d-flex gap-2 align-items-center flex-wrap">
|
||||
<div class="btn-group btn-group-sm" role="group" id="classroomPeriodSwitcher">
|
||||
<button type="button" class="btn btn-outline-success active" data-period="week" onclick="switchClassroomPeriod('week')">
|
||||
<button type="button" class="btn btn-outline-success active" data-period="today" onclick="switchClassroomPeriod('today')">
|
||||
<i class="bi bi-calendar-day me-1"></i>Hoy
|
||||
<span class="badge bg-success ms-1" id="classTodayBadge">{{ role_data.available_classrooms_today | length }}</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-success" data-period="week" onclick="switchClassroomPeriod('week')">
|
||||
<i class="bi bi-calendar-week me-1"></i>Esta Semana
|
||||
<span class="badge bg-success ms-1" id="classWeekBadge">{{ role_data.available_classrooms_week | length }}</span>
|
||||
</button>
|
||||
@@ -801,8 +1025,49 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body p-3">
|
||||
<!-- Vista Hoy -->
|
||||
<div id="classroomGridToday">
|
||||
{% if role_data.available_classrooms_today and role_data.available_classrooms_today | length > 0 %}
|
||||
<div class="row g-2">
|
||||
{% for aula in role_data.available_classrooms_today %}
|
||||
<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 {% if aula.is_virtual %}bg-info bg-opacity-10 border-info-subtle{% else %}bg-success bg-opacity-10 border-success-subtle{% endif %}">
|
||||
<div class="d-flex justify-content-between align-items-start mb-2">
|
||||
<span class="badge {% if aula.is_virtual %}bg-info-subtle text-info{% else %}bg-success-subtle text-success{% endif %} border font-monospace fw-bold">
|
||||
{{ aula.code }}
|
||||
</span>
|
||||
{% if aula.is_virtual %}
|
||||
<i class="bi bi-camera-video text-info"></i>
|
||||
{% else %}
|
||||
<i class="bi bi-door-open text-success"></i>
|
||||
{% endif %}
|
||||
</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">
|
||||
<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 en el día de hoy!</h6>
|
||||
<p class="text-muted small mb-0">Consulte el cronograma por piso o la cartelera del día.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Vista Semana -->
|
||||
<div id="classroomGridWeek">
|
||||
<div id="classroomGridWeek" style="display: none;">
|
||||
{% if role_data.available_classrooms_week and role_data.available_classrooms_week | length > 0 %}
|
||||
<div class="row g-2">
|
||||
{% for aula in role_data.available_classrooms_week %}
|
||||
@@ -1577,18 +1842,38 @@ document.querySelectorAll('[data-color]').forEach(function(el) {
|
||||
if (color) el.style.setProperty('background-color', color, 'important');
|
||||
});
|
||||
|
||||
// Bedelía: Switchers de período para paneles de Comisiones y Aulas
|
||||
// Bedelía: Switcher para Cartelera y Agenda de Clases
|
||||
function switchBedeliaScheduleView(view) {
|
||||
const todayEl = document.getElementById('bedeliaScheduleToday');
|
||||
const weekEl = document.getElementById('bedeliaScheduleWeek');
|
||||
if (todayEl) todayEl.style.display = view === 'today' ? '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);
|
||||
});
|
||||
}
|
||||
|
||||
// Bedelía: Switchers de período para paneles de Comisiones
|
||||
function switchCommPeriod(period) {
|
||||
document.getElementById('commTableWeek').style.display = period === 'week' ? 'block' : 'none';
|
||||
document.getElementById('commTableMonth').style.display = period === 'month' ? 'block' : 'none';
|
||||
const weekEl = document.getElementById('commTableWeek');
|
||||
const genEl = document.getElementById('commTableGeneral');
|
||||
const monthEl = document.getElementById('commTableMonth');
|
||||
if (weekEl) weekEl.style.display = period === 'week' ? 'block' : 'none';
|
||||
if (genEl) genEl.style.display = period === 'general' ? 'block' : 'none';
|
||||
if (monthEl) monthEl.style.display = period === 'month' ? 'block' : 'none';
|
||||
document.querySelectorAll('#commPeriodSwitcher button').forEach(function(btn) {
|
||||
btn.classList.toggle('active', btn.getAttribute('data-period') === period);
|
||||
});
|
||||
}
|
||||
|
||||
// Bedelía: Switchers de período para paneles de Aulas
|
||||
function switchClassroomPeriod(period) {
|
||||
document.getElementById('classroomGridWeek').style.display = period === 'week' ? 'block' : 'none';
|
||||
document.getElementById('classroomGridMonth').style.display = period === 'month' ? 'block' : 'none';
|
||||
const todayEl = document.getElementById('classroomGridToday');
|
||||
const weekEl = document.getElementById('classroomGridWeek');
|
||||
const monthEl = document.getElementById('classroomGridMonth');
|
||||
if (todayEl) todayEl.style.display = period === 'today' ? 'block' : 'none';
|
||||
if (weekEl) weekEl.style.display = period === 'week' ? 'block' : 'none';
|
||||
if (monthEl) monthEl.style.display = period === 'month' ? 'block' : 'none';
|
||||
document.querySelectorAll('#classroomPeriodSwitcher button').forEach(function(btn) {
|
||||
btn.classList.toggle('active', btn.getAttribute('data-period') === period);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user