fix(ux): hide mobile-header on desktop, relocate theme button above user profile, enhance flyout menus without clipping, and resolve current problems (v3.8.15)

This commit is contained in:
2026-10-26 14:20:55 -03:00
parent 67a1cb14a0
commit 6bf2a72d08
14 changed files with 316 additions and 78 deletions
+17 -17
View File
@@ -1,12 +1,12 @@
{
"name": "frontend",
"version": "1.0.0",
"version": "3.8.14",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "frontend",
"version": "1.0.0",
"version": "3.8.14",
"license": "ISC",
"dependencies": {
"axios": "^1.20.0",
@@ -107,18 +107,18 @@
}
},
"node_modules/body-parser": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz",
"integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==",
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.4.0.tgz",
"integrity": "sha512-Ifk1KcLrxaGt1occQagQNFNNOqRt1LFuehEnHHzB8Z6cRgIxRU1TBaiIsUiCdA+gy5PL7Y1IX31DNKkRmxtXjQ==",
"license": "MIT",
"dependencies": {
"bytes": "^3.1.2",
"content-type": "^2.0.0",
"content-type": "^2.1.0",
"debug": "^4.4.3",
"http-errors": "^2.0.1",
"iconv-lite": "^0.7.2",
"iconv-lite": "^0.7.3",
"on-finished": "^2.4.1",
"qs": "^6.15.2",
"qs": "^6.16.1",
"raw-body": "^3.0.2",
"type-is": "^2.1.0"
},
@@ -544,9 +544,9 @@
}
},
"node_modules/follow-redirects": {
"version": "1.16.0",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz",
"integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==",
"version": "1.16.2",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.2.tgz",
"integrity": "sha512-/kVP2U8z596Ia0gwFrwyIeo74ta5aVmSeU1FfAUMAmcEP5EP7zydmag3SLiN64NaRKef3lxsq7i/g7ltJQDGow==",
"funding": [
{
"type": "individual",
@@ -809,9 +809,9 @@
"license": "ISC"
},
"node_modules/ip-address": {
"version": "10.7.2",
"resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.2.tgz",
"integrity": "sha512-7H/2gFSIitxc0hG3nOI1glS8QLo/EHBFFLk8vEUjXY/xu0AdL8jZ9U1IzO2PUm0d2D/ofQcAifb0g6OBkt8U7w==",
"version": "10.7.5",
"resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.5.tgz",
"integrity": "sha512-t2v0rkILYv9WXmSL7TpAaU3HXgaFYOPUcH3QHgwQ++gpJuH3bqyMy4Fvt/DJCTKwzH3Cf+bAp5W/mFL39KPLzA==",
"license": "MIT",
"engines": {
"node": ">= 12"
@@ -1093,9 +1093,9 @@
}
},
"node_modules/qs": {
"version": "6.16.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.16.0.tgz",
"integrity": "sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA==",
"version": "6.16.1",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.16.1.tgz",
"integrity": "sha512-5Px6J7rfHBAGUhNQ3es4YzcOdBBw0SDcVtThJml4RdnKw4tKs2epA0kPZ+K8X+WiHktT93RHVcQ/3ym5aTCgtg==",
"license": "BSD-3-Clause",
"dependencies": {
"es-define-property": "^1.0.1",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "3.8.14",
"version": "3.8.15",
"description": "",
"main": "index.js",
"scripts": {
+7 -3
View File
@@ -21,22 +21,26 @@
updateToggleButtons(theme);
}
// 3. Actualizar iconos de los botones de toggle
// 3. Actualizar iconos y textos de los botones de toggle
function updateToggleButtons(theme) {
const buttons = document.querySelectorAll('.theme-toggle-btn');
buttons.forEach(btn => {
const icon = btn.querySelector('i');
if (icon) {
if (theme === 'dark') {
icon.className = 'bi bi-sun-fill';
icon.className = 'bi bi-sun-fill text-warning';
btn.setAttribute('aria-label', 'Cambiar a modo claro');
btn.setAttribute('title', 'Modo Claro');
} else {
icon.className = 'bi bi-moon-stars-fill';
icon.className = 'bi bi-moon-stars-fill text-primary';
btn.setAttribute('aria-label', 'Cambiar a modo oscuro');
btn.setAttribute('title', 'Modo Oscuro');
}
}
const label = btn.querySelector('.theme-label');
if (label) {
label.textContent = theme === 'dark' ? 'Modo Claro' : 'Modo Oscuro';
}
});
}
+3 -3
View File
@@ -86,9 +86,9 @@ const env = nunjucks.configure(path.join(__dirname, '../views'), {
});
// Versiones institucionales del sistema
const APP_VERSION = '3.8.14';
const FRONTEND_VERSION = '3.8.14';
const BACKEND_VERSION = '3.8.14';
const APP_VERSION = '3.8.15';
const FRONTEND_VERSION = '3.8.15';
const BACKEND_VERSION = '3.8.15';
env.addGlobal('app_version', APP_VERSION);
env.addGlobal('frontend_version', FRONTEND_VERSION);
+242 -36
View File
@@ -536,13 +536,10 @@
padding: 0.5rem 0.25rem !important;
}
.sidebar.collapsed .sidebar-header .sidebar-header-actions {
flex-direction: column !important;
gap: 6px !important;
}
.sidebar.collapsed .sidebar-header .theme-toggle-btn {
width: 32px !important;
height: 32px !important;
font-size: 0.85rem !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
width: 100% !important;
}
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-text,
@@ -599,14 +596,12 @@
min-width: unset !important;
}
.sidebar.collapsed .sidebar-footer {
padding: 0.5rem !important;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.sidebar.collapsed .sidebar-footer .theme-toggle-btn {
margin-bottom: 0.5rem !important;
padding: 0.5rem 0.25rem !important;
display: flex !important;
flex-direction: column !important;
align-items: center !important;
justify-content: center !important;
overflow: visible !important;
}
/* Ocultar cualquier animación o flujo vertical de Bootstrap dentro de los 68px */
@@ -628,10 +623,12 @@
left: 100% !important;
top: 0 !important;
margin-left: 10px !important;
min-width: 230px !important;
min-width: 240px !important;
max-height: calc(100vh - 24px) !important;
overflow-y: auto !important;
background: #FFFFFF !important;
border: 1px solid rgba(180, 62, 142, 0.22) !important;
border-radius: 12px !important;
border-radius: 14px !important;
box-shadow: 0 12px 32px rgba(180, 62, 142, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08) !important;
z-index: 1090 !important;
padding: 0.5rem 0 !important;
@@ -698,6 +695,164 @@
color: #FF8AB6 !important;
}
/* --- MENÚ DE USUARIO PROLIJO & FLYOUT PARA SIDEBAR COLAPSADO --- */
.user-dropdown-container {
width: 100%;
position: relative;
}
.user-profile-btn {
border: 1px solid transparent;
transition: all 0.2s ease;
cursor: pointer;
}
.user-profile-btn:hover,
.user-profile-btn[aria-expanded="true"] {
background-color: rgba(180, 62, 142, 0.08) !important;
border-color: rgba(180, 62, 142, 0.2) !important;
}
[data-bs-theme="dark"] .user-profile-btn:hover,
[data-bs-theme="dark"] .user-profile-btn[aria-expanded="true"] {
background-color: rgba(255, 138, 182, 0.1) !important;
border-color: rgba(255, 138, 182, 0.25) !important;
}
.user-dropdown-menu {
border-radius: 14px !important;
border: 1px solid rgba(180, 62, 142, 0.22) !important;
background: #FFFFFF !important;
box-shadow: 0 12px 32px rgba(180, 62, 142, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08) !important;
overflow: hidden;
width: 100%;
min-width: 240px;
z-index: 1095;
animation: flyoutSlideIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-bs-theme="dark"] .user-dropdown-menu {
background: #18202F !important;
border-color: rgba(255, 138, 182, 0.25) !important;
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6) !important;
}
.user-dropdown-menu .flyout-header {
font-size: 0.78rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.05em;
padding: 0.6rem 1rem 0.5rem;
color: #B43E8E !important;
border-bottom: 1px solid rgba(180, 62, 142, 0.12);
margin-bottom: 0;
background: rgba(180, 62, 142, 0.04);
}
[data-bs-theme="dark"] .user-dropdown-menu .flyout-header {
color: #FF8AB6 !important;
border-bottom-color: rgba(255, 255, 255, 0.08);
background: rgba(255, 138, 182, 0.06);
}
.user-dropdown-menu .sidebar-submenu .nav-link {
padding: 0.55rem 0.85rem !important;
font-size: 0.85rem;
white-space: nowrap;
display: flex !important;
align-items: center !important;
border-radius: 8px !important;
color: #1E293B !important;
text-decoration: none;
transition: all 0.15s ease;
}
[data-bs-theme="dark"] .user-dropdown-menu .sidebar-submenu .nav-link {
color: #F8FAFC !important;
}
.user-dropdown-menu .sidebar-submenu .nav-link:hover {
background-color: rgba(180, 62, 142, 0.1) !important;
color: #B43E8E !important;
}
[data-bs-theme="dark"] .user-dropdown-menu .sidebar-submenu .nav-link:hover {
background-color: rgba(255, 138, 182, 0.15) !important;
color: #FF8AB6 !important;
}
.user-dropdown-menu .sidebar-submenu .nav-link.hover-danger:hover {
background-color: rgba(239, 68, 68, 0.12) !important;
color: #EF4444 !important;
}
/* En Sidebar Colapsado */
.sidebar.collapsed .user-dropdown-container {
width: 100% !important;
display: flex !important;
justify-content: center !important;
position: relative !important;
}
.sidebar.collapsed .user-profile-btn {
width: 44px !important;
height: 44px !important;
padding: 0 !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
border-radius: 12px !important;
margin: 0 auto !important;
}
.sidebar.collapsed .user-profile-btn::after {
display: none !important;
}
.sidebar.collapsed .user-dropdown-menu {
position: absolute !important;
left: 100% !important;
bottom: 0 !important;
top: auto !important;
margin-left: 10px !important;
min-width: 250px !important;
width: 250px !important;
border-radius: 14px !important;
z-index: 1095 !important;
transform: none !important;
animation: flyoutSlideIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
/* --- BOTÓN DE TEMA SOBRE EL BOTÓN DE USUARIO --- */
.theme-toggle-container {
width: 100%;
}
.theme-toggle-btn {
border: 1px solid rgba(180, 62, 142, 0.2);
background: rgba(180, 62, 142, 0.06);
color: #B43E8E;
cursor: pointer;
transition: all 0.2s ease;
}
.theme-toggle-btn:hover {
background: rgba(180, 62, 142, 0.14);
border-color: rgba(180, 62, 142, 0.35);
color: #8C256B;
transform: translateY(-1px);
}
[data-bs-theme="dark"] .theme-toggle-btn {
border-color: rgba(255, 255, 255, 0.12);
background: rgba(255, 255, 255, 0.06);
color: #F1F5F9;
}
[data-bs-theme="dark"] .theme-toggle-btn:hover {
background: rgba(255, 138, 182, 0.15);
border-color: rgba(255, 138, 182, 0.35);
color: #FF8AB6;
transform: translateY(-1px);
}
.sidebar.collapsed .theme-toggle-container {
width: 100% !important;
display: flex !important;
justify-content: center !important;
margin-bottom: 6px !important;
}
.sidebar.collapsed .theme-toggle-btn {
width: 44px !important;
height: 44px !important;
padding: 0 !important;
border-radius: 12px !important;
display: inline-flex !important;
align-items: center !important;
justify-content: center !important;
margin: 0 auto !important;
}
/* Navegación del Sidebar */
.sidebar-nav {
padding: 0;
@@ -769,9 +924,9 @@
margin-top: 0 !important;
}
/* Mobile Header */
/* Mobile Header: 100% oculto en Desktop, activo exclusivamente en pantallas móviles < 992px */
.mobile-header {
display: none;
display: none !important;
}
@media (max-width: 991.98px) {
.sidebar {
@@ -896,9 +1051,6 @@
<span class="brand-text fs-5">Edu-Space</span>
</a>
<div class="d-flex align-items-center gap-1 sidebar-header-actions">
<button class="theme-toggle-btn" type="button" aria-label="Cambiar tema" title="Modo Claro/Oscuro">
<i class="bi bi-moon-stars-fill"></i>
</button>
<button class="sidebar-toggle-btn d-none d-lg-inline-flex" id="sidebarToggle" type="button" aria-label="Alternar menú lateral" title="Alternar menú lateral">
<i class="bi bi-layout-sidebar-inset fs-5"></i>
</button>
@@ -1110,28 +1262,67 @@
</ul>
</div>
<div class="sidebar-footer p-3 border-top border-secondary-subtle">
<div class="d-flex align-items-center justify-content-center mb-3 sidebar-footer-text">
<div class="sidebar-footer p-2 p-lg-3 border-top border-secondary-subtle">
<div class="d-flex align-items-center justify-content-center mb-2 sidebar-footer-text">
{% include 'partials/language_switcher.html' %}
</div>
<div class="dropdown dropup">
<a href="#" class="d-flex align-items-center text-decoration-none dropdown-toggle text-body w-100" data-bs-toggle="dropdown" aria-expanded="false">
<div class="user-avatar-small bg-primary text-white rounded-circle d-flex align-items-center justify-content-center" style="width:32px; height:32px; font-weight:bold; flex-shrink:0;">
<!-- Botón de Tema: Situado abajo, directamente SOBRE el botón de usuario -->
<div class="theme-toggle-container mb-2">
<button class="theme-toggle-btn w-100 d-flex align-items-center justify-content-between px-3 py-2 border-0 rounded-3 shadow-none" type="button" aria-label="Cambiar tema" title="Modo Claro / Oscuro">
<div class="d-flex align-items-center gap-2">
<i class="bi bi-moon-stars-fill theme-icon fs-6"></i>
<span class="sidebar-footer-text small fw-medium theme-label">Modo Claro</span>
</div>
<span class="sidebar-footer-text badge bg-secondary-subtle text-secondary-emphasis rounded-pill px-2 py-0" style="font-size:0.68rem;">Auto</span>
</button>
</div>
<!-- Botón y Menú Desplegable de Usuario (Prolijo & Estilo Flyout) -->
<div class="dropdown dropup user-dropdown-container position-relative">
<a href="#" class="user-profile-btn d-flex align-items-center text-decoration-none text-body w-100 p-2 rounded-3" data-bs-toggle="dropdown" aria-expanded="false" id="userMenuDropdown">
<div class="user-avatar-small bg-primary text-white rounded-circle d-flex align-items-center justify-content-center shadow-sm" style="width:34px; height:34px; font-weight:bold; flex-shrink:0;">
{{ auth_user.name[0]|upper if auth_user.name else 'U' }}
</div>
<div class="ms-2 sidebar-footer-text text-truncate flex-grow-1" style="min-width:0;">
<small class="d-block fw-semibold text-truncate">{{ auth_user.first_name or auth_user.name }}</small>
<small class="text-muted d-block text-truncate" style="font-size:0.7rem;">{{ auth_user.role_badge_display.label if (auth_user and auth_user.role_badge_display) else (auth_user.role|capitalize if auth_user else 'Usuario') }}</small>
</div>
<i class="bi bi-chevron-up ms-auto fs-7 text-muted sidebar-footer-text"></i>
</a>
<ul class="dropdown-menu shadow-sm border-0 mb-2">
<li><h6 class="dropdown-header">{{ auth_user.email if auth_user else '' }}</h6></li>
<li><a class="dropdown-item" href="/auth/profile"><i class="bi bi-person me-2"></i>Mi Perfil</a></li>
<li><a class="dropdown-item" href="/auth/change_password"><i class="bi bi-key me-2"></i>Cambiar Contraseña</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item text-danger" href="/auth/logout"><i class="bi bi-box-arrow-right me-2"></i>Cerrar Sesión</a></li>
</ul>
<div class="dropdown-menu user-dropdown-menu shadow-lg border-0 mb-2 p-0" aria-labelledby="userMenuDropdown">
<div class="flyout-header d-flex align-items-center">
<i class="bi bi-person-circle me-2 fs-6"></i>
<span class="text-truncate flex-grow-1">{{ auth_user.name or 'Usuario' }}</span>
</div>
<div class="px-3 py-1 bg-body-tertiary border-bottom border-secondary-subtle">
<div class="text-muted small text-truncate" style="font-size: 0.75rem;">{{ auth_user.email if auth_user else '' }}</div>
<span class="badge bg-primary bg-opacity-10 text-primary border border-primary-subtle rounded-pill mt-1" style="font-size:0.65rem;">
{{ auth_user.role_badge_display.label if (auth_user and auth_user.role_badge_display) else (auth_user.role|capitalize if auth_user else 'Usuario') }}
</span>
</div>
<ul class="sidebar-submenu p-1 m-0 list-unstyled">
<li>
<a class="nav-link py-2 px-3 d-flex align-items-center rounded-2" href="/auth/profile">
<i class="bi bi-person text-primary me-2 fs-6"></i>
<span>Mi Perfil</span>
</a>
</li>
<li>
<a class="nav-link py-2 px-3 d-flex align-items-center rounded-2" href="/auth/change_password">
<i class="bi bi-key text-warning me-2 fs-6"></i>
<span>Cambiar Contraseña</span>
</a>
</li>
<li><hr class="dropdown-divider my-1"></li>
<li>
<a class="nav-link py-2 px-3 d-flex align-items-center rounded-2 text-danger hover-danger" href="/auth/logout">
<i class="bi bi-box-arrow-right text-danger me-2 fs-6"></i>
<span>Cerrar Sesión</span>
</a>
</li>
</ul>
</div>
</div>
<div class="sidebar-footer-text mt-3 pt-2 border-top border-secondary-subtle text-center">
@@ -1144,8 +1335,8 @@
<!-- Main Content Wrapper -->
<div class="main-content">
<!-- Mobile Header -->
<div class="mobile-header shadow-sm d-flex align-items-center justify-content-between px-3">
<!-- Mobile Header (Visible EXCLUSIVAMENTE en dispositivos móviles y tablets < 992px) -->
<div class="mobile-header shadow-sm d-lg-none align-items-center justify-content-between px-3">
<a href="/dashboard" class="text-decoration-none brand-link d-flex align-items-center">
<img src="/img/logo_unicaba_mini.png" alt="Logo UniCABA" class="navbar-logo me-2" height="24">
<span class="brand-text fw-bold fs-6">Edu-Space</span>
@@ -1378,9 +1569,22 @@
});
}
function adjustFlyoutPosition(flyout) {
if (!flyout) return;
flyout.style.top = '';
flyout.style.bottom = '';
const rect = flyout.getBoundingClientRect();
const windowH = window.innerHeight;
if (rect.bottom > windowH - 12) {
const diff = rect.bottom - (windowH - 12);
flyout.style.top = `-${diff}px`;
}
}
// Manejo de clicks e interacciones en submenús cuando el sidebar está colapsado (Flyout)
document.querySelectorAll('#sidebarNav > .nav-item').forEach(function(item) {
const trigger = item.querySelector('[data-bs-toggle="collapse"]');
const flyout = item.querySelector('.collapse');
if (trigger) {
trigger.addEventListener('click', function(e) {
if (sidebar.classList.contains('collapsed')) {
@@ -1393,6 +1597,7 @@
});
if (!isAlreadyOpen) {
item.classList.add('show-flyout');
if (flyout) adjustFlyoutPosition(flyout);
}
}
}, true);
@@ -1403,6 +1608,7 @@
document.querySelectorAll('#sidebarNav > .nav-item.show-flyout').forEach(function(other) {
if (other !== item) other.classList.remove('show-flyout');
});
if (flyout) adjustFlyoutPosition(flyout);
}
});
});
+5 -4
View File
@@ -1,6 +1,6 @@
{% extends "base.html" %}
{% block title %}{{ classroom.code_display }} - Classroom Details - Edu-Space Admin{% endblock %}
{% block title %}{{ classroom.code_display }} - Detalle del Aula - Edu-Space Admin{% endblock %}
{% block content %}
<div class="container-fluid pt-5 mt-4">
@@ -9,7 +9,7 @@
<div class="col-md-7">
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-1 small">
<li class="breadcrumb-item"><a href="/classrooms/list_classrooms">Classrooms</a></li>
<li class="breadcrumb-item"><a href="/classrooms/list_classrooms">Aulas</a></li>
<li class="breadcrumb-item active">{{ classroom.code_display }}</li>
</ol>
</nav>
@@ -17,11 +17,11 @@
<i class="bi bi-door-open text-primary"></i> {{ classroom.code_display }}
{% if classroom.is_active %}
<span class="badge bg-success-subtle text-success border border-success-subtle fs-6">
<i class="bi bi-check-circle me-1"></i>Active
<i class="bi bi-check-circle me-1"></i>Activa
</span>
{% else %}
<span class="badge bg-danger-subtle text-danger border border-danger-subtle fs-6">
<i class="bi bi-x-circle me-1"></i>Inactive
<i class="bi bi-x-circle me-1"></i>Inactiva
</span>
{% endif %}
</h1>
@@ -216,6 +216,7 @@
</div>
</div>
</div>
</div>
<!-- Modal Confirmar Eliminación de Aula -->
<div class="modal fade text-start" id="modalDeleteClassroom" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
+1
View File
@@ -192,6 +192,7 @@
</button>
</div>
</div>
</div>
<div class="card-body p-3">
<!-- Timeline View: Agrupado por franja horaria real sin repeticiones -->
<div id="timeline-view">