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:
+242
-36
@@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user