{% block extra_css %}{% endblock %}
{% if current_user.is_authenticated %}
{{ config.APP_NAME }}
Dashboard
Contraseñas
{% if current_user.can_admin() %}
Admin
Administración
Usuarios
Gestionar usuarios del sistema
Departamentos
Organizar por departamentos
Logs del Sistema
Auditoría y seguimiento
{% endif %}
Herramientas
Herramientas
Exportar
Descargar contraseñas
{% if current_user.can_edit() %}
Importar
Cargar desde archivo
{% endif %}
initializeThemeToggle(); // Theme toggle functionality function initializeThemeToggle() { const themeToggle = document.getElementById('themeToggle'); const themeIcon = document.getElementById('themeIcon'); const html = document.documentElement; // Aplicar tema inicial basado en la configuración del servidor const currentTheme = '{{ current_theme }}'; if (currentTheme === 'dark') { html.classList.add('dark'); themeIcon.className = 'fas fa-sun text-yellow-500 dark:text-yellow-400'; } else { html.classList.remove('dark'); themeIcon.className = 'fas fa-moon text-gray-600 dark:text-gray-400'; } if (themeToggle) { themeToggle.addEventListener('click', function() { // Obtener el token CSRF const csrfToken = document.querySelector('meta[name="csrf-token"]').getAttribute('content'); // Mostrar loader showLoader(); fetch('/toggle-theme', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-CSRFToken': csrfToken }, credentials: 'same-origin' }) .then(response => response.json()) .then(data => { if (data.success) { // Cambiar el tema visual if (data.theme === 'dark') { html.classList.add('dark'); themeIcon.className = 'fas fa-sun text-yellow-500 dark:text-yellow-400'; themeToggle.title = 'Cambiar a tema claro'; } else { html.classList.remove('dark'); themeIcon.className = 'fas fa-moon text-gray-600 dark:text-gray-400'; themeToggle.title = 'Cambiar a tema oscuro'; } // Mostrar mensaje de éxito temporal showToast(`Tema cambiado a ${data.theme === 'dark' ? 'oscuro' : 'claro'}`, 'success'); } else { showToast('Error al cambiar el tema', 'error'); } }) .catch(error => { console.error('Error:', error); showToast('Error al cambiar el tema', 'error'); }) .finally(() => { hideLoader(); }); }); } } // Función para mostrar toast notifications function showToast(message, type = 'info') { const toast = document.createElement('div'); toast.className = `fixed top-20 right-4 z-50 alert alert-${type} animate-fade-in-up max-w-sm`; toast.innerHTML = `
${message}
`; document.body.appendChild(toast); // Auto-remove after 3 seconds setTimeout(() => { toast.style.transform = 'translateX(100%)'; toast.style.opacity = '0'; setTimeout(() => toast.remove(), 300); }, 3000); } {% if current_user.can_edit() %}
Nueva
{% endif %}
{{ current_user.username[0].upper() }}
{{ current_user.username }}
{{ current_user.role.title() }}
{{ current_user.username[0].upper() }}
{{ current_user.username }}
{{ current_user.email }}
{{ current_user.role.title() }}
{% if current_user.two_factor_enabled %}
2FA
{% endif %}
Mi Perfil
Configuración personal
Dashboard
Panel principal
Cerrar Sesión
Salir de la aplicación
Dashboard
Contraseñas
{% if current_user.can_admin() %}
Administración
Usuarios
Departamentos
Logs del Sistema
{% endif %}
Herramientas
Exportar Contraseñas
{% if current_user.can_edit() %}
Importar Contraseñas
{% endif %}
{{ current_user.username[0].upper() }}
{{ current_user.username }}
{{ current_user.email }}
Mi Perfil
Cerrar Sesión
{% endif %} {% with messages = get_flashed_messages(with_categories=true) %} {% if messages %}
{% for category, message in messages %}
{% if category == 'error' %}
{% elif category == 'warning' %}
{% elif category == 'success' %}
{% else %}
{% endif %}
{{ message }}
{% endfor %}
{% endif %} {% endwith %}
{% block content %}{% endblock %}
{% if not current_user.is_authenticated %} {% endif %}
Cargando...
{% block extra_js %}{% endblock %}