fix(ui): improve dark mode contrast in google sheets import (v3.8.23)

This commit is contained in:
2026-10-27 06:54:17 -03:00
parent 619767ef1b
commit 52dc3aece0
8 changed files with 250 additions and 55 deletions
+3 -1
View File
@@ -229,4 +229,6 @@ apuntes
.credentials .credentials
.credenciales .credenciales
participantes_export.json participantes_export.json
*export.json␍ *export.json
scratch/
␍
+11
View File
@@ -11,6 +11,17 @@ El formato está basado en [Keep a Changelog](https://keepachangelog.com/es-ES/1
- **Sincronización Continua Moodle (Fase 6):** Automatización de workers persistentes en background para el procesamiento continuo de la cola de Web Services Moodle 4.1. - **Sincronización Continua Moodle (Fase 6):** Automatización de workers persistentes en background para el procesamiento continuo de la cola de Web Services Moodle 4.1.
- **Pruebas de Carga y Hardening (Fase 6):** Pruebas de estrés de concurrencia y validación final de producción. - **Pruebas de Carga y Hardening (Fase 6):** Pruebas de estrés de concurrencia y validación final de producción.
## [3.8.23] - 2026-10-27
### Improved & Fixed (UI / UX)
- **Importador de Google Sheets: Optimización de Contrastes en Modo Oscuro (`admin/google_sheets_import`)**:
- Resueltos problemas de bajo contraste en elementos clave de la vista en modo oscuro (`[data-bs-theme="dark"]`):
- Pastillas y botones selectores de días (`.day-pill`, `.btn-quick-week`) con bordes de alto contraste, fondos oscuros definidos (`#14192b`) y estados hover/activo legibles.
- Tarjetas de selección de entidades importables (`.import-entity-card`) con bordes sutiles pero visibles y realce al ser seleccionadas (`border-color: #3b82f6`).
- Paneles de ámbito temporal y rangos de fechas (`.panel-temporal-box`) con fondos integrados y textos con contraste WCAG AA.
- Badges de alerta, filtros activos y estados de fila (`bg-warning-subtle text-warning-emphasis`, `bg-body-secondary text-body`) sustituyendo textos opacos o ilegibles.
- Textos secundarios (`text-secondary`, `text-muted`) ajustados con variables CSS y colores claros (`#cbd5e1`, `#94a3b8`) para lectura sin esfuerzo en pantallas oscuras.
- Desglose semanal por día de cursada y tabla de previsualización con colores consistentes de texto (`text-body`, fondos adaptativos `bg-body`).
## [3.8.22] - 2026-10-26 ## [3.8.22] - 2026-10-26
### Improved & Fixed (UI / UX) ### Improved & Fixed (UI / UX)
- **Gestión de Asignaturas: Optimización de Modales y Tabla Antidesbordamiento (`admin/subjects_list`)**: - **Gestión de Asignaturas: Optimización de Modales y Tabla Antidesbordamiento (`admin/subjects_list`)**:
+7 -8
View File
@@ -9,15 +9,14 @@ Memoria del proyecto entre sesiones para la rama `dev`.
- Libro de Calificaciones (*Gradebook*) con actas de regularidad inmutables. - Libro de Calificaciones (*Gradebook*) con actas de regularidad inmutables.
- Autenticación híbrida (Google OAuth 2.0, Moodle SSO, Local) y Modo Impersonación. - Autenticación híbrida (Google OAuth 2.0, Moodle SSO, Local) y Modo Impersonación.
- Reinicialización segura del sistema con contraseña de Administrador. - Reinicialización segura del sistema con contraseña de Administrador.
- **Sprint Activo: Optimización UI/UX en Asignaturas y Modales Antidesbordamiento — v3.8.22**: - **Sprint Activo: Optimización de Contrastes en Modo Oscuro (Google Sheets Import) — v3.8.23**:
- **Rediseño UI/UX de Asignaturas (`admin/subjects_list`)**: - **Rediseño y Alto Contraste en Modo Oscuro (`admin/google_sheets_import`)**:
- Modales `#modalAddSubject` y `#modalEditSubject` transformados a formato de 2 columnas (`modal-lg modal-dialog-centered modal-dialog-scrollable`). - Optimizado el contraste visual de pastillas de días de la semana (`.day-pill`), botones rápidos (`.btn-quick-week`), y tarjetas de selección de entidades importables (`.import-entity-card`) para `[data-bs-theme="dark"]`.
- Eliminado el amontonamiento vertical; footer fijo con botones "Guardar Cambios" y "Cancelar" siempre visibles e inaccesibles al corte por altura de pantalla. - Ajustado el panel de ámbito temporal (`.panel-temporal-box`) con fondos integrados y bordes definidos.
- Columna izquierda con formulario académico completo (Código, Créditos, Nombre, Departamento, Descripción y switch de estado activo). - Sustituidas clases opacas por badges temáticos de alto contraste (`bg-warning-subtle text-warning-emphasis`, `bg-body-secondary text-body`).
- Columna derecha con selector de carreras enriquecido (filtro en vivo, "Todas"/"Ninguna", scroll suave y tarjetas interactivas). - Mejorada la legibilidad de textos secundarios y muted (`#cbd5e1`, `#94a3b8`) y celdas de previsualización en la tabla de importación masiva.
- Tabla con anchos mínimos por columna (`min-width`) y `text-wrap` para evitar truncamientos y desbordamientos.
- **QA & Seguridad**: 80 tests aprobados en `pytest` (100%), 0 vulnerabilidades en auditoría de seguridad. - **QA & Seguridad**: 80 tests aprobados en `pytest` (100%), 0 vulnerabilidades en auditoría de seguridad.
- **Versión Consolidada**: `v3.8.22`. - **Versión Consolidada**: `v3.8.23`.
## Decisiones (y por qué) ## Decisiones (y por qué)
- **Flujo Secuencial de Bedelía (9 Pasos)**: Estandarizar la carga operativa en: 1) Sede -> 2) Aula -> 3) Ciclo Lectivo -> 4) Carrera -> 5) Materia (vinculada a Carrera) -> 6) Comisión (asociada a Materia, Carrera y Ciclo) -> 7) Profesores -> 8) Alumnos -> 9) Reserva de Espacio. Esto asegura consistencia e integridad relacional. - **Flujo Secuencial de Bedelía (9 Pasos)**: Estandarizar la carga operativa en: 1) Sede -> 2) Aula -> 3) Ciclo Lectivo -> 4) Carrera -> 5) Materia (vinculada a Carrera) -> 6) Comisión (asociada a Materia, Carrera y Ciclo) -> 7) Profesores -> 8) Alumnos -> 9) Reserva de Espacio. Esto asegura consistencia e integridad relacional.
+1 -1
View File
@@ -7,7 +7,7 @@ from typing import Any
from database import db, get_db, engine, SessionLocal, session from database import db, get_db, engine, SessionLocal, session
from config.config import Config from config.config import Config
__version__ = "3.8.22" __version__ = "3.8.23"
class DummyContext: class DummyContext:
def __enter__(self): def __enter__(self):
+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.8.22", version="3.8.23",
description="Administrative interface for Edu-Space Classroom Management System (FastAPI ASGI Core)", description="Administrative interface for Edu-Space Classroom Management System (FastAPI ASGI Core)",
author="Edu-Space Development Team", author="Edu-Space Development Team",
author_email="admin@edu-space.com", author_email="admin@edu-space.com",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "frontend", "name": "frontend",
"version": "3.8.22", "version": "3.8.23",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
+3 -3
View File
@@ -86,9 +86,9 @@ const env = nunjucks.configure(path.join(__dirname, '../views'), {
}); });
// Versiones institucionales del sistema // Versiones institucionales del sistema
const APP_VERSION = '3.8.22'; const APP_VERSION = '3.8.23';
const FRONTEND_VERSION = '3.8.22'; const FRONTEND_VERSION = '3.8.23';
const BACKEND_VERSION = '3.8.22'; const BACKEND_VERSION = '3.8.23';
env.addGlobal('app_version', APP_VERSION); env.addGlobal('app_version', APP_VERSION);
env.addGlobal('frontend_version', FRONTEND_VERSION); env.addGlobal('frontend_version', FRONTEND_VERSION);
+223 -40
View File
@@ -6,6 +6,46 @@
<!-- Flatpickr CSS --> <!-- Flatpickr CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<style> <style>
/* Mejoras de Contraste y Componentes Visuales del Importador */
.day-pill {
background-color: var(--bs-body-bg);
border: 1px solid var(--bs-border-color);
color: var(--bs-body-color);
transition: all 0.2s ease-in-out;
cursor: pointer;
}
.day-pill:hover {
border-color: #0d6efd;
}
.day-pill:has(.filter-day-chk:checked) {
background-color: rgba(13, 110, 253, 0.12);
border-color: #0d6efd;
color: #0d6efd;
}
.day-pill label {
cursor: pointer;
}
.import-entity-card {
background-color: var(--bs-tertiary-bg);
border: 1px solid var(--bs-border-color);
transition: all 0.2s ease-in-out;
}
.import-entity-card:has(.import-entity-chk:checked) {
border-color: rgba(13, 110, 253, 0.4);
background-color: rgba(13, 110, 253, 0.08);
}
.panel-temporal-box {
background-color: var(--bs-body-bg);
border: 1px solid var(--bs-border-color);
}
.btn-quick-week {
transition: all 0.15s ease-in-out;
}
/* Flatpickr en General */
.flatpickr-calendar { .flatpickr-calendar {
font-family: inherit; font-family: inherit;
border-radius: 0.5rem; border-radius: 0.5rem;
@@ -18,6 +58,149 @@
font-weight: 600; font-weight: 600;
letter-spacing: 0.5px; letter-spacing: 0.5px;
} }
/* ==========================================================================
MODO OSCURO ([data-bs-theme="dark"]) - ALTO CONTRASTE Y LEGIBILIDAD
========================================================================== */
[data-bs-theme="dark"] .form-text,
[data-bs-theme="dark"] .text-muted {
color: #94a3b8 !important;
}
[data-bs-theme="dark"] .text-secondary {
color: #cbd5e1 !important;
}
/* Tarjetas de Entidades en Modo Oscuro */
[data-bs-theme="dark"] .import-entity-card {
background-color: #14192b !important;
border-color: rgba(255, 255, 255, 0.12) !important;
}
[data-bs-theme="dark"] .import-entity-card:has(.import-entity-chk:checked) {
background-color: rgba(13, 110, 253, 0.18) !important;
border-color: #3b82f6 !important;
}
/* Pastillas de Días en Modo Oscuro */
[data-bs-theme="dark"] .day-pill {
background-color: #14192b !important;
border-color: rgba(255, 255, 255, 0.15) !important;
color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .day-pill:hover {
border-color: #60a5fa !important;
background-color: rgba(255, 255, 255, 0.05) !important;
}
[data-bs-theme="dark"] .day-pill:has(.filter-day-chk:checked) {
background-color: rgba(13, 110, 253, 0.28) !important;
border-color: #3b82f6 !important;
color: #ffffff !important;
box-shadow: 0 0 8px rgba(59, 130, 246, 0.3) !important;
}
/* Paneles de Alcance Temporal en Modo Oscuro */
[data-bs-theme="dark"] .panel-temporal-box {
background-color: #14192b !important;
border-color: rgba(255, 255, 255, 0.12) !important;
}
/* Inputs y Controles en Modo Oscuro */
[data-bs-theme="dark"] .form-control {
background-color: #0f1322 !important;
border-color: rgba(255, 255, 255, 0.15) !important;
color: #f8fafc !important;
}
[data-bs-theme="dark"] .form-control::placeholder {
color: #64748b !important;
}
[data-bs-theme="dark"] .form-control:focus {
border-color: #3b82f6 !important;
box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25) !important;
}
[data-bs-theme="dark"] .input-group-text {
background-color: #1a2035 !important;
border-color: rgba(255, 255, 255, 0.15) !important;
color: #e2e8f0 !important;
}
/* Botones de accesos rápidos */
[data-bs-theme="dark"] .btn-quick-week {
background-color: rgba(255, 255, 255, 0.04) !important;
border-color: rgba(255, 255, 255, 0.15) !important;
color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .btn-quick-week:hover {
background-color: rgba(255, 255, 255, 0.1) !important;
border-color: #94a3b8 !important;
color: #ffffff !important;
}
[data-bs-theme="dark"] .btn-quick-week.btn-outline-primary {
background-color: rgba(13, 110, 253, 0.18) !important;
border-color: #3b82f6 !important;
color: #93c5fd !important;
}
[data-bs-theme="dark"] .btn-quick-week.btn-outline-primary:hover {
background-color: #0d6efd !important;
color: #ffffff !important;
}
/* Flatpickr en Modo Oscuro */
[data-bs-theme="dark"] .flatpickr-calendar {
background: #1a2035 !important;
border: 1px solid rgba(255, 255, 255, 0.15) !important;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
color: #f8fafc !important;
}
[data-bs-theme="dark"] .flatpickr-months {
background: #14192b !important;
border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}
[data-bs-theme="dark"] .flatpickr-months .flatpickr-month,
[data-bs-theme="dark"] .flatpickr-current-month,
[data-bs-theme="dark"] .flatpickr-current-month .cur-month,
[data-bs-theme="dark"] .flatpickr-current-month input.cur-year {
color: #f8fafc !important;
fill: #f8fafc !important;
}
[data-bs-theme="dark"] .flatpickr-weekdays,
[data-bs-theme="dark"] span.flatpickr-weekday {
background: #14192b !important;
color: #94a3b8 !important;
}
[data-bs-theme="dark"] .flatpickr-day {
color: #e2e8f0 !important;
}
[data-bs-theme="dark"] .flatpickr-day:hover {
background: rgba(255, 255, 255, 0.12) !important;
}
[data-bs-theme="dark"] .flatpickr-day.selected,
[data-bs-theme="dark"] .flatpickr-day.startRange,
[data-bs-theme="dark"] .flatpickr-day.endRange {
background: #0d6efd !important;
border-color: #0d6efd !important;
color: #ffffff !important;
}
[data-bs-theme="dark"] .flatpickr-day.flatpickr-disabled,
[data-bs-theme="dark"] .flatpickr-day.flatpickr-disabled:hover {
color: #475569 !important;
}
/* Grilla de Inspección Previa */
[data-bs-theme="dark"] #previewTable thead th {
background-color: #1a2035 !important;
color: #f8fafc !important;
border-bottom: 2px solid rgba(255, 255, 255, 0.15) !important;
}
[data-bs-theme="dark"] #previewTable tbody tr:hover td {
background-color: rgba(255, 255, 255, 0.04) !important;
}
[data-bs-theme="dark"] #previewTable .table-danger td {
background-color: rgba(220, 53, 69, 0.2) !important;
color: #fca5a5 !important;
}
[data-bs-theme="dark"] #previewTable .table-warning td {
background-color: rgba(255, 193, 7, 0.15) !important;
color: #fde047 !important;
}
</style> </style>
{% endblock %} {% endblock %}
@@ -208,7 +391,7 @@
</div> </div>
<div class="row g-2"> <div class="row g-2">
<div class="col-sm-6 col-lg"> <div class="col-sm-6 col-lg">
<div class="form-check p-2 border rounded bg-body-tertiary h-100 shadow-sm-sm"> <div class="form-check p-2 border rounded bg-body-tertiary h-100 shadow-sm-sm import-entity-card">
<input class="form-check-input ms-1 me-2 import-entity-chk" type="checkbox" name="import_reservations" id="chk_import_reservations" value="true" checked> <input class="form-check-input ms-1 me-2 import-entity-chk" type="checkbox" name="import_reservations" id="chk_import_reservations" value="true" checked>
<label class="form-check-label fw-semibold small" for="chk_import_reservations"> <label class="form-check-label fw-semibold small" for="chk_import_reservations">
<i class="bi bi-calendar-check text-danger me-1"></i>Asignaciones (Reservas) <i class="bi bi-calendar-check text-danger me-1"></i>Asignaciones (Reservas)
@@ -217,7 +400,7 @@
</div> </div>
</div> </div>
<div class="col-sm-6 col-lg"> <div class="col-sm-6 col-lg">
<div class="form-check p-2 border rounded bg-body-tertiary h-100 shadow-sm-sm"> <div class="form-check p-2 border rounded bg-body-tertiary h-100 shadow-sm-sm import-entity-card">
<input class="form-check-input ms-1 me-2 import-entity-chk" type="checkbox" name="import_classrooms" id="chk_import_classrooms" value="true" checked> <input class="form-check-input ms-1 me-2 import-entity-chk" type="checkbox" name="import_classrooms" id="chk_import_classrooms" value="true" checked>
<label class="form-check-label fw-semibold small" for="chk_import_classrooms"> <label class="form-check-label fw-semibold small" for="chk_import_classrooms">
<i class="bi bi-door-open text-success me-1"></i>Aulas Físicas y Virtuales <i class="bi bi-door-open text-success me-1"></i>Aulas Físicas y Virtuales
@@ -226,7 +409,7 @@
</div> </div>
</div> </div>
<div class="col-sm-6 col-lg"> <div class="col-sm-6 col-lg">
<div class="form-check p-2 border rounded bg-body-tertiary h-100 shadow-sm-sm"> <div class="form-check p-2 border rounded bg-body-tertiary h-100 shadow-sm-sm import-entity-card">
<input class="form-check-input ms-1 me-2 import-entity-chk" type="checkbox" name="import_commissions" id="chk_import_commissions" value="true" checked> <input class="form-check-input ms-1 me-2 import-entity-chk" type="checkbox" name="import_commissions" id="chk_import_commissions" value="true" checked>
<label class="form-check-label fw-semibold small" for="chk_import_commissions"> <label class="form-check-label fw-semibold small" for="chk_import_commissions">
<i class="bi bi-diagram-3 text-warning me-1"></i>Comisiones de Cursada <i class="bi bi-diagram-3 text-warning me-1"></i>Comisiones de Cursada
@@ -235,7 +418,7 @@
</div> </div>
</div> </div>
<div class="col-sm-6 col-lg"> <div class="col-sm-6 col-lg">
<div class="form-check p-2 border rounded bg-body-tertiary h-100 shadow-sm-sm"> <div class="form-check p-2 border rounded bg-body-tertiary h-100 shadow-sm-sm import-entity-card">
<input class="form-check-input ms-1 me-2 import-entity-chk" type="checkbox" name="import_subjects" id="chk_import_subjects" value="true" checked> <input class="form-check-input ms-1 me-2 import-entity-chk" type="checkbox" name="import_subjects" id="chk_import_subjects" value="true" checked>
<label class="form-check-label fw-semibold small" for="chk_import_subjects"> <label class="form-check-label fw-semibold small" for="chk_import_subjects">
<i class="bi bi-book text-info me-1"></i>Asignaturas / Materias <i class="bi bi-book text-info me-1"></i>Asignaturas / Materias
@@ -244,7 +427,7 @@
</div> </div>
</div> </div>
<div class="col-sm-6 col-lg"> <div class="col-sm-6 col-lg">
<div class="form-check p-2 border rounded bg-body-tertiary h-100 shadow-sm-sm"> <div class="form-check p-2 border rounded bg-body-tertiary h-100 shadow-sm-sm import-entity-card">
<input class="form-check-input ms-1 me-2 import-entity-chk" type="checkbox" name="import_careers" id="chk_import_careers" value="true" checked> <input class="form-check-input ms-1 me-2 import-entity-chk" type="checkbox" name="import_careers" id="chk_import_careers" value="true" checked>
<label class="form-check-label fw-semibold small" for="chk_import_careers"> <label class="form-check-label fw-semibold small" for="chk_import_careers">
<i class="bi bi-mortarboard text-primary me-1"></i>Carreras Académicas <i class="bi bi-mortarboard text-primary me-1"></i>Carreras Académicas
@@ -271,7 +454,7 @@
<div class="d-flex flex-wrap gap-2" id="daysCheckboxesContainer"> <div class="d-flex flex-wrap gap-2" id="daysCheckboxesContainer">
{% set all_days = ['Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'] %} {% set all_days = ['Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'] %}
{% for d in all_days %} {% for d in all_days %}
<div class="form-check form-check-inline border rounded px-3 py-1 bg-white shadow-sm mb-0"> <div class="form-check form-check-inline border rounded px-3 py-2 day-pill mb-0">
<input class="form-check-input filter-day-chk" type="checkbox" name="filter_days" id="day_chk_{{ loop.index }}" value="{{ d }}" <input class="form-check-input filter-day-chk" type="checkbox" name="filter_days" id="day_chk_{{ loop.index }}" value="{{ d }}"
{% if not filter_days or (d in filter_days) or (filter_day and (filter_day == d or filter_day == 'ALL')) %}checked{% endif %}> {% if not filter_days or (d in filter_days) or (filter_day and (filter_day == d or filter_day == 'ALL')) %}checked{% endif %}>
<label class="form-check-label small fw-semibold cursor-pointer" for="day_chk_{{ loop.index }}">{{ d }}</label> <label class="form-check-label small fw-semibold cursor-pointer" for="day_chk_{{ loop.index }}">{{ d }}</label>
@@ -324,7 +507,7 @@
<i class="bi bi-calendar-event me-1 text-danger"></i>Fecha Manual Sugerida (DD/MM/AAAA): <i class="bi bi-calendar-event me-1 text-danger"></i>Fecha Manual Sugerida (DD/MM/AAAA):
</label> </label>
<div class="input-group input-group-sm"> <div class="input-group input-group-sm">
<span class="input-group-text bg-white"><i class="bi bi-calendar-event text-danger"></i></span> <span class="input-group-text bg-body-secondary"><i class="bi bi-calendar-event text-danger"></i></span>
<input type="text" name="manual_date" id="manual_date" class="form-control font-monospace text-center date-input-picker" <input type="text" name="manual_date" id="manual_date" class="form-control font-monospace text-center date-input-picker"
value="{{ manual_date | format_date if manual_date else '' }}" placeholder="DD/MM/AAAA" maxlength="10"> value="{{ manual_date | format_date if manual_date else '' }}" placeholder="DD/MM/AAAA" maxlength="10">
</div> </div>
@@ -361,7 +544,7 @@
</div> </div>
<!-- Panel: Por Semanas --> <!-- Panel: Por Semanas -->
<div id="panel_temporal_weeks" class="p-3 bg-white border rounded shadow-sm {% if single_date_only or date_from %}d-none{% endif %}"> <div id="panel_temporal_weeks" class="p-3 panel-temporal-box bg-body rounded shadow-sm {% if single_date_only or date_from %}d-none{% endif %}">
<div class="row g-3 align-items-center"> <div class="row g-3 align-items-center">
<div class="col-md-4"> <div class="col-md-4">
<label for="weeks_to_generate" class="form-label fw-semibold small mb-1"> <label for="weeks_to_generate" class="form-label fw-semibold small mb-1">
@@ -377,10 +560,10 @@
<div class="col-md-8"> <div class="col-md-8">
<label class="form-label fw-semibold small mb-1 text-muted">Accesos Rápidos:</label> <label class="form-label fw-semibold small mb-1 text-muted">Accesos Rápidos:</label>
<div class="d-flex flex-wrap gap-2"> <div class="d-flex flex-wrap gap-2">
<button type="button" class="btn btn-sm btn-outline-secondary py-1 px-2" onclick="setWeeksValue(1)">1 sem (Corte semanal)</button> <button type="button" class="btn btn-sm btn-outline-secondary btn-quick-week py-1 px-2" onclick="setWeeksValue(1)">1 sem (Corte semanal)</button>
<button type="button" class="btn btn-sm btn-outline-secondary py-1 px-2" onclick="setWeeksValue(4)">4 sem (1 Mes)</button> <button type="button" class="btn btn-sm btn-outline-secondary btn-quick-week py-1 px-2" onclick="setWeeksValue(4)">4 sem (1 Mes)</button>
<button type="button" class="btn btn-sm btn-outline-secondary py-1 px-2" onclick="setWeeksValue(8)">8 sem (Medio Cuat.)</button> <button type="button" class="btn btn-sm btn-outline-secondary btn-quick-week py-1 px-2" onclick="setWeeksValue(8)">8 sem (Medio Cuat.)</button>
<button type="button" class="btn btn-sm btn-outline-primary py-1 px-2 fw-semibold" onclick="setWeeksValue(16)">16 sem (Cuatrimestre Regular)</button> <button type="button" class="btn btn-sm btn-outline-primary btn-quick-week py-1 px-2 fw-semibold" onclick="setWeeksValue(16)">16 sem (Cuatrimestre Regular)</button>
</div> </div>
</div> </div>
</div> </div>
@@ -390,14 +573,14 @@
</div> </div>
<!-- Panel: Rango de Fechas (Desde - Hasta) --> <!-- Panel: Rango de Fechas (Desde - Hasta) -->
<div id="panel_temporal_range" class="p-3 bg-white border rounded shadow-sm {% if single_date_only or not date_from %}d-none{% endif %}"> <div id="panel_temporal_range" class="p-3 panel-temporal-box bg-body rounded shadow-sm {% if single_date_only or not date_from %}d-none{% endif %}">
<div class="row g-3 align-items-center"> <div class="row g-3 align-items-center">
<div class="col-md-5"> <div class="col-md-5">
<label for="date_from" class="form-label fw-semibold small mb-1"> <label for="date_from" class="form-label fw-semibold small mb-1">
<i class="bi bi-calendar-event text-success me-1"></i>Fecha de Inicio (Desde): <i class="bi bi-calendar-event text-success me-1"></i>Fecha de Inicio (Desde):
</label> </label>
<div class="input-group input-group-sm"> <div class="input-group input-group-sm">
<span class="input-group-text bg-white"><i class="bi bi-calendar-event text-success"></i></span> <span class="input-group-text bg-body-secondary"><i class="bi bi-calendar-event text-success"></i></span>
<input type="text" class="form-control font-monospace text-center date-input-picker" id="date_from" name="date_from" <input type="text" class="form-control font-monospace text-center date-input-picker" id="date_from" name="date_from"
value="{{ date_from | format_date if date_from else '' }}" placeholder="DD/MM/AAAA" maxlength="10" onchange="onRangeInputChange()"> value="{{ date_from | format_date if date_from else '' }}" placeholder="DD/MM/AAAA" maxlength="10" onchange="onRangeInputChange()">
</div> </div>
@@ -407,7 +590,7 @@
<i class="bi bi-calendar-check text-danger me-1"></i>Fecha de Fin (Hasta): <i class="bi bi-calendar-check text-danger me-1"></i>Fecha de Fin (Hasta):
</label> </label>
<div class="input-group input-group-sm"> <div class="input-group input-group-sm">
<span class="input-group-text bg-white"><i class="bi bi-calendar-check text-danger"></i></span> <span class="input-group-text bg-body-secondary"><i class="bi bi-calendar-check text-danger"></i></span>
<input type="text" class="form-control font-monospace text-center date-input-picker" id="date_to" name="date_to" <input type="text" class="form-control font-monospace text-center date-input-picker" id="date_to" name="date_to"
value="{{ date_to | format_date if date_to else '' }}" placeholder="DD/MM/AAAA" maxlength="10" onchange="onRangeInputChange()"> value="{{ date_to | format_date if date_to else '' }}" placeholder="DD/MM/AAAA" maxlength="10" onchange="onRangeInputChange()">
</div> </div>
@@ -424,12 +607,12 @@
</div> </div>
<!-- Panel: Fecha Puntual Única --> <!-- Panel: Fecha Puntual Única -->
<div id="panel_temporal_single" class="p-3 bg-white border rounded shadow-sm {% if not single_date_only %}d-none{% endif %}"> <div id="panel_temporal_single" class="p-3 panel-temporal-box bg-body rounded shadow-sm {% if not single_date_only %}d-none{% endif %}">
<div class="d-flex flex-wrap align-items-center justify-content-between gap-3"> <div class="d-flex flex-wrap align-items-center justify-content-between gap-3">
<div> <div>
<div class="form-check form-switch mb-1"> <div class="form-check form-switch mb-1">
<input class="form-check-input" type="checkbox" role="switch" id="single_date_only" name="single_date_only" value="true" {% if single_date_only %}checked{% endif %} onchange="onSingleDateSwitchChange()"> <input class="form-check-input" type="checkbox" role="switch" id="single_date_only" name="single_date_only" value="true" {% if single_date_only %}checked{% endif %} onchange="onSingleDateSwitchChange()">
<label class="form-check-label fw-bold text-dark small" for="single_date_only"> <label class="form-check-label fw-bold text-body small" for="single_date_only">
<i class="bi bi-pin-angle-fill text-warning me-1"></i>Importar ÚNICAMENTE para fecha puntual <i class="bi bi-pin-angle-fill text-warning me-1"></i>Importar ÚNICAMENTE para fecha puntual
</label> </label>
</div> </div>
@@ -438,11 +621,11 @@
</span> </span>
</div> </div>
<div style="min-width: 220px;"> <div style="min-width: 220px;">
<label for="single_punctual_date" class="form-label fw-semibold small mb-1 text-secondary"> <label for="single_punctual_date" class="form-label fw-semibold small mb-1 text-body-secondary">
Fecha Puntual Asignada: Fecha Puntual Asignada:
</label> </label>
<div class="input-group input-group-sm"> <div class="input-group input-group-sm">
<span class="input-group-text bg-white"><i class="bi bi-pin-angle-fill text-warning"></i></span> <span class="input-group-text bg-body-secondary"><i class="bi bi-pin-angle-fill text-warning"></i></span>
<input type="text" class="form-control font-monospace text-center date-input-picker" id="single_punctual_date" <input type="text" class="form-control font-monospace text-center date-input-picker" id="single_punctual_date"
value="{{ manual_date | format_date if manual_date else '' }}" placeholder="DD/MM/AAAA" maxlength="10" onchange="syncSingleDateToManualDate(this.value)"> value="{{ manual_date | format_date if manual_date else '' }}" placeholder="DD/MM/AAAA" maxlength="10" onchange="syncSingleDateToManualDate(this.value)">
</div> </div>
@@ -456,7 +639,7 @@
<div class="p-3 bg-body-tertiary rounded border mb-4"> <div class="p-3 bg-body-tertiary rounded border mb-4">
<div class="d-flex flex-wrap justify-content-between align-items-center gap-3"> <div class="d-flex flex-wrap justify-content-between align-items-center gap-3">
<div class="d-flex align-items-center gap-2"> <div class="d-flex align-items-center gap-2">
<span class="badge bg-secondary-subtle text-secondary border px-3 py-2 fw-semibold" id="temporalSummaryBadge"> <span class="badge bg-secondary-subtle text-body border px-3 py-2 fw-semibold" id="temporalSummaryBadge">
{% if single_date_only %} {% if single_date_only %}
<i class="bi bi-pin-angle-fill me-1 text-warning"></i>Alcance: 1 sola asignación puntual {{ '(' + (manual_date | format_date) + ')' if manual_date else '' }} <i class="bi bi-pin-angle-fill me-1 text-warning"></i>Alcance: 1 sola asignación puntual {{ '(' + (manual_date | format_date) + ')' if manual_date else '' }}
{% elif date_from and date_to %} {% elif date_from and date_to %}
@@ -493,7 +676,7 @@
<small class="text-muted">Revise, deseleccione filas individuales y ajuste las fechas de cursada antes de confirmar la subida.</small> <small class="text-muted">Revise, deseleccione filas individuales y ajuste las fechas de cursada antes de confirmar la subida.</small>
</div> </div>
<div class="d-flex align-items-center gap-2"> <div class="d-flex align-items-center gap-2">
<span class="badge bg-white text-dark border"> <span class="badge bg-body-secondary text-body border">
Total detectado: <strong id="previewTotalCount">0</strong> Total detectado: <strong id="previewTotalCount">0</strong>
</span> </span>
<span class="badge bg-success text-white"> <span class="badge bg-success text-white">
@@ -506,13 +689,13 @@
<div class="row g-2 align-items-center mb-3"> <div class="row g-2 align-items-center mb-3">
<div class="col-md-5"> <div class="col-md-5">
<div class="input-group input-group-sm"> <div class="input-group input-group-sm">
<span class="input-group-text bg-white"><i class="bi bi-search"></i></span> <span class="input-group-text bg-body-secondary"><i class="bi bi-search"></i></span>
<input type="text" id="previewSearchInput" class="form-control" placeholder="Buscar por código, materia, carrera o aula..." oninput="onPreviewSearch()"> <input type="text" id="previewSearchInput" class="form-control" placeholder="Buscar por código, materia, carrera o aula..." oninput="onPreviewSearch()">
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="input-group input-group-sm"> <div class="input-group input-group-sm">
<span class="input-group-text bg-white small"><i class="bi bi-calendar-event me-1"></i>Fecha masiva:</span> <span class="input-group-text bg-body-secondary small"><i class="bi bi-calendar-event me-1"></i>Fecha masiva:</span>
<input type="text" id="bulkDateInput" class="form-control text-center font-monospace" placeholder="DD/MM/AAAA" maxlength="10"> <input type="text" id="bulkDateInput" class="form-control text-center font-monospace" placeholder="DD/MM/AAAA" maxlength="10">
<button type="button" class="btn btn-outline-secondary" onclick="applyBulkDate()" title="Aplica esta fecha a todos los registros seleccionados"> <button type="button" class="btn btn-outline-secondary" onclick="applyBulkDate()" title="Aplica esta fecha a todos los registros seleccionados">
Aplicar Aplicar
@@ -530,7 +713,7 @@
<!-- Tabla de Previsualización --> <!-- Tabla de Previsualización -->
<div class="table-responsive border rounded mb-3" style="max-height: 520px; overflow-y: auto;"> <div class="table-responsive border rounded mb-3" style="max-height: 520px; overflow-y: auto;">
<table class="table table-hover table-striped align-middle mb-0 small" id="previewTable"> <table class="table table-hover table-striped align-middle mb-0 small" id="previewTable">
<thead class="table-light sticky-top shadow-sm"> <thead class="bg-body-secondary sticky-top shadow-sm">
<tr> <tr>
<th class="text-center" style="width: 40px;"> <th class="text-center" style="width: 40px;">
<input class="form-check-input" type="checkbox" id="chkSelectAllPreview" onchange="toggleMasterPreviewCheckbox(this.checked)" checked title="Seleccionar/Deseleccionar todos"> <input class="form-check-input" type="checkbox" id="chkSelectAllPreview" onchange="toggleMasterPreviewCheckbox(this.checked)" checked title="Seleccionar/Deseleccionar todos">
@@ -574,7 +757,7 @@
<div class="d-flex flex-wrap align-items-center gap-1 pt-2 border-top"> <div class="d-flex flex-wrap align-items-center gap-1 pt-2 border-top">
<span class="small text-muted me-2">Hojas de cursada configuradas:</span> <span class="small text-muted me-2">Hojas de cursada configuradas:</span>
{% for s in metrics.sheets %} {% for s in metrics.sheets %}
<span class="badge bg-body-tertiary text-secondary border small"> <span class="badge bg-body-tertiary text-body border small">
<i class="bi bi-calendar-check me-1 text-primary"></i>{{ s.name }} <i class="bi bi-calendar-check me-1 text-primary"></i>{{ s.name }}
</span> </span>
{% endfor %} {% endfor %}
@@ -591,7 +774,7 @@
</h5> </h5>
<div class="d-flex gap-2 align-items-center"> <div class="d-flex gap-2 align-items-center">
{% if stats.filters_applied %} {% if stats.filters_applied %}
<span class="badge bg-light text-dark border"> <span class="badge bg-body-secondary text-body border">
<i class="bi bi-funnel-fill text-primary me-1"></i>Filtros Activos <i class="bi bi-funnel-fill text-primary me-1"></i>Filtros Activos
</span> </span>
{% endif %} {% endif %}
@@ -601,28 +784,28 @@
<div class="card-body"> <div class="card-body">
<!-- Resumen de Filtros Aplicados si hubo alguno --> <!-- Resumen de Filtros Aplicados si hubo alguno -->
{% if stats.filters_applied %} {% if stats.filters_applied %}
<div class="p-3 mb-3 rounded bg-light border"> <div class="p-3 mb-3 rounded bg-body border">
<div class="d-flex flex-wrap gap-3 align-items-center small"> <div class="d-flex flex-wrap gap-3 align-items-center small">
<div> <div>
<strong class="text-secondary"><i class="bi bi-calendar3 me-1"></i>Día:</strong> <strong class="text-body-secondary"><i class="bi bi-calendar3 me-1"></i>Día:</strong>
<span class="badge bg-primary-subtle text-primary border border-primary-subtle">{{ stats.filters_applied.day or 'Todos los Días' }}</span> <span class="badge bg-primary-subtle text-primary border border-primary-subtle">{{ stats.filters_applied.day or 'Todos los Días' }}</span>
</div> </div>
<div> <div>
<strong class="text-secondary"><i class="bi bi-mortarboard me-1"></i>Carrera:</strong> <strong class="text-body-secondary"><i class="bi bi-mortarboard me-1"></i>Carrera:</strong>
<span class="badge bg-info-subtle text-info border border-info-subtle">{{ stats.filters_applied.career or 'Todas las Carreras' }}</span> <span class="badge bg-info-subtle text-info border border-info-subtle">{{ stats.filters_applied.career or 'Todas las Carreras' }}</span>
</div> </div>
<div> <div>
<strong class="text-secondary"><i class="bi bi-book me-1"></i>Materia:</strong> <strong class="text-body-secondary"><i class="bi bi-book me-1"></i>Materia:</strong>
<span class="badge bg-secondary-subtle text-secondary border">{{ stats.filters_applied.subject or 'Todas las Materias' }}</span> <span class="badge bg-secondary-subtle text-body border">{{ stats.filters_applied.subject or 'Todas las Materias' }}</span>
</div> </div>
<div> <div>
<strong class="text-secondary"><i class="bi bi-calendar-event me-1"></i>Fecha Manual:</strong> <strong class="text-body-secondary"><i class="bi bi-calendar-event me-1"></i>Fecha Manual:</strong>
<span class="badge {% if stats.filters_applied.manual_date %}bg-warning-subtle text-dark border border-warning-subtle{% else %}bg-light text-muted border{% endif %}"> <span class="badge {% if stats.filters_applied.manual_date %}bg-warning-subtle text-warning-emphasis border border-warning-subtle{% else %}bg-body-secondary text-body-secondary border{% endif %}">
{{ stats.filters_applied.manual_date or 'No requerida' }} {{ stats.filters_applied.manual_date or 'No requerida' }}
</span> </span>
</div> </div>
<div> <div>
<strong class="text-secondary"><i class="bi bi-clock-history me-1"></i>Generación:</strong> <strong class="text-body-secondary"><i class="bi bi-clock-history me-1"></i>Generación:</strong>
<span class="badge {% if stats.filters_applied.temporal_scope == 'single_date' or stats.filters_applied.single_date_only %}bg-warning-subtle text-warning border border-warning-subtle{% elif stats.filters_applied.temporal_scope == 'date_range' %}bg-info-subtle text-info border border-info-subtle{% else %}bg-success-subtle text-success border border-success-subtle{% endif %}"> <span class="badge {% if stats.filters_applied.temporal_scope == 'single_date' or stats.filters_applied.single_date_only %}bg-warning-subtle text-warning border border-warning-subtle{% elif stats.filters_applied.temporal_scope == 'date_range' %}bg-info-subtle text-info border border-info-subtle{% else %}bg-success-subtle text-success border border-success-subtle{% endif %}">
{% if stats.filters_applied.temporal_scope == 'single_date' or stats.filters_applied.single_date_only %} {% if stats.filters_applied.temporal_scope == 'single_date' or stats.filters_applied.single_date_only %}
Fecha puntual única (1 asignación) Fecha puntual única (1 asignación)
@@ -634,7 +817,7 @@
</span> </span>
</div> </div>
<div> <div>
<strong class="text-secondary"><i class="bi bi-check-all me-1"></i>Filas Coincidentes:</strong> <strong class="text-body-secondary"><i class="bi bi-check-all me-1"></i>Filas Coincidentes:</strong>
<span class="fw-bold text-success">{{ stats.matching_rows if stats.matching_rows is defined else stats.total_rows_processed }}</span> <span class="fw-bold text-success">{{ stats.matching_rows if stats.matching_rows is defined else stats.total_rows_processed }}</span>
<span class="text-muted">/ {{ stats.total_rows_processed }} totales</span> <span class="text-muted">/ {{ stats.total_rows_processed }} totales</span>
</div> </div>
@@ -684,14 +867,14 @@
{% if stats.by_day %} {% if stats.by_day %}
<div class="card bg-body-tertiary border mb-3"> <div class="card bg-body-tertiary border mb-3">
<div class="card-header bg-transparent py-2 border-bottom"> <div class="card-header bg-transparent py-2 border-bottom">
<h6 class="mb-0 small fw-bold text-dark"><i class="bi bi-calendar3 me-2 text-primary"></i>Desglose Semanal por Día de Cursada:</h6> <h6 class="mb-0 small fw-bold text-body"><i class="bi bi-calendar3 me-2 text-primary"></i>Desglose Semanal por Día de Cursada:</h6>
</div> </div>
<div class="card-body p-2"> <div class="card-body p-2">
<div class="row g-2 text-center"> <div class="row g-2 text-center">
{% for day_name, d_info in stats.by_day %} {% for day_name, d_info in stats.by_day %}
<div class="col-md-2 col-4"> <div class="col-md-2 col-4">
<div class="p-2 border rounded bg-white shadow-sm"> <div class="p-2 border rounded bg-body shadow-sm">
<span class="fw-bold d-block text-secondary small">{{ day_name }}</span> <span class="fw-bold d-block text-body small">{{ day_name }}</span>
<span class="badge {% if d_info.status == 'OK' %}bg-success-subtle text-success border border-success-subtle{% else %}bg-danger-subtle text-danger border border-danger-subtle{% endif %}"> <span class="badge {% if d_info.status == 'OK' %}bg-success-subtle text-success border border-success-subtle{% else %}bg-danger-subtle text-danger border border-danger-subtle{% endif %}">
{{ d_info.rows_count }} filas {{ d_info.rows_count }} filas
</span> </span>
@@ -1290,7 +1473,7 @@
if (isInvalid) { if (isInvalid) {
estadoBadge = '<span class="badge bg-danger text-white"><i class="bi bi-x-circle me-1"></i>Inválido</span>'; estadoBadge = '<span class="badge bg-danger text-white"><i class="bi bi-x-circle me-1"></i>Inválido</span>';
} else if (hasWarning) { } else if (hasWarning) {
estadoBadge = '<span class="badge bg-warning-subtle text-dark border border-warning-subtle" title="' + (row.warning_msg || 'Advertencia') + '"><i class="bi bi-exclamation-triangle me-1"></i>' + (row.warning_msg || 'Alerta') + '</span>'; estadoBadge = '<span class="badge bg-warning-subtle text-warning-emphasis border border-warning-subtle" title="' + (row.warning_msg || 'Advertencia') + '"><i class="bi bi-exclamation-triangle me-1"></i>' + (row.warning_msg || 'Alerta') + '</span>';
} else { } else {
estadoBadge = '<span class="badge bg-success-subtle text-success border border-success-subtle"><i class="bi bi-check-circle me-1"></i>Listo</span>'; estadoBadge = '<span class="badge bg-success-subtle text-success border border-success-subtle"><i class="bi bi-check-circle me-1"></i>Listo</span>';
} }
@@ -1310,7 +1493,7 @@
'<td><span class="badge bg-primary-subtle text-primary border border-primary-subtle">' + (row.dia || '-') + '</span></td>' + '<td><span class="badge bg-primary-subtle text-primary border border-primary-subtle">' + (row.dia || '-') + '</span></td>' +
'<td><div class="fw-semibold">' + (row.turno || '') + '</div><small class="text-muted">' + (row.horario || '') + '</small></td>' + '<td><div class="fw-semibold">' + (row.turno || '') + '</div><small class="text-muted">' + (row.horario || '') + '</small></td>' +
'<td>' + '<td>' +
'<div class="fw-bold text-dark">' + (row.codigo || '') + '</div>' + '<div class="fw-bold text-body">' + (row.codigo || '') + '</div>' +
'<div class="small text-secondary text-truncate" style="max-width: 220px;" title="' + (row.asignatura || '') + '">' + (row.asignatura || '') + '</div>' + '<div class="small text-secondary text-truncate" style="max-width: 220px;" title="' + (row.asignatura || '') + '">' + (row.asignatura || '') + '</div>' +
'</td>' + '</td>' +
'<td><small class="text-muted d-block text-truncate" style="max-width: 160px;" title="' + carText + '">' + carText + '</small></td>' + '<td><small class="text-muted d-block text-truncate" style="max-width: 160px;" title="' + carText + '">' + carText + '</small></td>' +