82 lines
5.0 KiB
Plaintext
82 lines
5.0 KiB
Plaintext
<nav class="navbar navbar-dark bg-dark sticky-top app-topbar">
|
|
<div class="container-fluid px-3">
|
|
<div class="d-flex align-items-center gap-2">
|
|
<% if (user) { %>
|
|
<button class="btn btn-sm btn-icon-glass text-white d-md-none me-1" type="button" data-bs-toggle="offcanvas" data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-label="Abrir menú">
|
|
<i class="fas fa-bars fs-5"></i>
|
|
</button>
|
|
<% } %>
|
|
<a class="navbar-brand d-flex align-items-center gap-2 m-0" href="/">
|
|
<div class="brand-logo-glow">
|
|
<img src="/img/logo.svg" alt="Help Desk Logo" width="28" height="28" class="d-inline-block align-text-top rounded-1">
|
|
</div>
|
|
<div class="d-flex flex-column">
|
|
<span class="brand-text">Help Desk <span class="brand-subtext d-none d-sm-inline">& FSM</span></span>
|
|
</div>
|
|
</a>
|
|
<% if (typeof company !== 'undefined' && company) { %>
|
|
<% if (typeof user !== 'undefined' && user && user.rol === 'superadmin' && typeof allCompanies !== 'undefined' && allCompanies.length > 1) { %>
|
|
<div class="dropdown ms-2 d-none d-lg-inline-block">
|
|
<button class="company-nav-pill dropdown-toggle d-flex align-items-center gap-1.5 border-0 bg-transparent text-white" type="button" data-bs-toggle="dropdown" aria-expanded="false" title="Cambiar Empresa (Superadmin)">
|
|
<i class="fas fa-building text-info" style="font-size: 0.75rem;"></i>
|
|
<span class="company-name-text fw-semibold"><%= company.name %></span>
|
|
<span class="badge company-plan-badge"><%= company.plan %></span>
|
|
<i class="fas fa-chevron-down ms-1 text-muted" style="font-size: 0.62rem;"></i>
|
|
</button>
|
|
<ul class="dropdown-menu dropdown-menu-dark shadow-lg border-secondary mt-1 py-1" style="font-size: 0.85rem; min-width: 220px;">
|
|
<li class="dropdown-header text-uppercase text-muted fw-bold" style="font-size: 0.65rem; letter-spacing: 0.5px;">
|
|
<i class="fas fa-exchange-alt me-1 text-info"></i> Entornos / Empresas
|
|
</li>
|
|
<% allCompanies.forEach(c => { %>
|
|
<li>
|
|
<a class="dropdown-item d-flex align-items-center justify-content-between py-2 <%= c.id === company.id ? 'active' : '' %>" href="/saas/switch/<%= c.id %>">
|
|
<span class="fw-medium"><%= c.name %></span>
|
|
<span class="badge <%= c.id === company.id ? 'bg-info text-dark' : 'bg-dark text-muted border border-secondary' %>" style="font-size: 0.65rem;">
|
|
<%= c.slug %>
|
|
</span>
|
|
</a>
|
|
</li>
|
|
<% }) %>
|
|
<li><hr class="dropdown-divider my-1 border-secondary"></li>
|
|
<li>
|
|
<a class="dropdown-item py-1.5 text-warning small d-flex align-items-center gap-1.5" href="/saas/companies">
|
|
<i class="fas fa-sliders-h"></i> Gestionar Empresas
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<% } else { %>
|
|
<div class="company-nav-pill ms-2 d-none d-lg-flex align-items-center gap-1.5">
|
|
<i class="fas fa-building text-info" style="font-size: 0.75rem;"></i>
|
|
<span class="company-name-text"><%= company.name %></span>
|
|
<span class="badge company-plan-badge"><%= company.plan %></span>
|
|
</div>
|
|
<% } %>
|
|
<% } %>
|
|
</div>
|
|
|
|
<% if (user) { %>
|
|
<div class="d-flex align-items-center gap-2 gap-sm-3">
|
|
<div class="user-profile-badge d-flex align-items-center gap-2">
|
|
<% if (user.avatar_url) { %>
|
|
<img src="<%= user.avatar_url %>" alt="<%= user.nombre %>" class="user-avatar-img">
|
|
<% } else { %>
|
|
<div class="user-avatar-initials">
|
|
<%= (user.nombre || 'U').charAt(0).toUpperCase() %>
|
|
</div>
|
|
<% } %>
|
|
<div class="d-none d-sm-flex flex-column text-start">
|
|
<span class="user-nav-name"><%= user.nombre %></span>
|
|
<span class="user-nav-role badge-role-<%= user.rol %>"><%= user.rol %></span>
|
|
</div>
|
|
</div>
|
|
|
|
<a href="/logout" class="btn btn-logout-glass btn-sm d-flex align-items-center gap-1.5" title="Cerrar Sesión">
|
|
<i class="fas fa-sign-out-alt"></i>
|
|
<span class="d-none d-md-inline">Salir</span>
|
|
</a>
|
|
</div>
|
|
<% } %>
|
|
</div>
|
|
</nav>
|