Mass UI Updates

This commit is contained in:
2025-12-15 14:54:29 -06:00
parent cf1ffac9ee
commit 13bb6542bc
11 changed files with 3060 additions and 121 deletions
+74 -20
View File
@@ -9,23 +9,45 @@
<link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
</head>
<body class="min-h-screen bg-gray-50">
<body class="min-h-screen bg-gradient-to-br from-gray-50 via-blue-50/30 to-indigo-50/40">
<!-- Navigation Header -->
<nav class="bg-white shadow-sm border-b border-gray-200">
<nav class="backdrop-blur-xl bg-white/70 border-b border-white/20 shadow-sm sticky top-0 z-40">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex flex-col sm:flex-row justify-between items-center h-16 sm:h-auto py-4 sm:py-0 gap-4 sm:gap-0">
<div class="flex items-center gap-4 w-full sm:w-auto">
<a href="dashboard.html" class="text-indigo-600 hover:text-indigo-700 font-medium text-sm sm:text-base">← Dashboard</a>
<div class="text-lg sm:text-xl font-bold text-gray-800">Employee Reports</div>
<div class="flex flex-row justify-between items-center py-4 px-2">
<div class="flex items-center gap-4">
<a href="dashboard" class="text-indigo-600 hover:text-indigo-700 font-medium text-sm sm:text-base transition-colors">← Dashboard</a>
</div>
<div class="flex flex-col sm:flex-row items-center gap-3 w-full sm:w-auto">
<div class="text-xs sm:text-sm text-gray-600" id="userEmail"></div>
<button
onclick="logout()"
class="w-full sm:w-auto bg-red-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 transition"
>
Logout
</button>
<div class="flex items-center gap-3 relative">
<div class="relative">
<button
onclick="toggleUserDropdown()"
class="w-10 h-10 rounded-full bg-gradient-to-br from-indigo-500 via-purple-500 to-pink-500 flex items-center justify-center text-white font-medium text-sm hover:scale-105 focus:outline-none transition-all duration-300 shadow-lg shadow-indigo-500/30 hover:shadow-indigo-500/50"
id="userAvatarBtn"
>
<span id="userInitials" class="text-xs font-semibold"></span>
</button>
<div
id="userDropdown"
class="hidden absolute right-0 mt-2 w-48 backdrop-blur-xl bg-white/80 rounded-2xl shadow-2xl border border-white/30 py-2 z-50 overflow-hidden"
>
<div class="px-4 py-3 border-b border-white/20">
<p class="text-xs text-gray-500 font-medium">Signed in as</p>
<p class="text-sm font-semibold text-gray-900 truncate mt-0.5" id="userEmail"></p>
</div>
<a
href="preferences"
class="block px-4 py-2.5 text-sm text-gray-700 hover:bg-white/40 focus:outline-none transition-colors font-medium"
>
Preferences
</a>
<button
onclick="logout()"
class="w-full text-left px-4 py-2.5 text-sm text-red-600 hover:bg-red-50/50 focus:outline-none transition-colors font-medium"
>
Logout
</button>
</div>
</div>
</div>
</div>
</div>
@@ -57,7 +79,7 @@
</div>
<!-- Reports Table Container -->
<div id="reportsTableContainer" class="hidden bg-white rounded-lg shadow border border-gray-200 overflow-hidden">
<div id="reportsTableContainer" class="hidden backdrop-blur-xl bg-white/60 rounded-2xl shadow-xl border border-white/30 overflow-hidden">
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
@@ -115,7 +137,7 @@
<div>
<label for="noteJob" class="block text-sm font-medium text-gray-700 mb-1">Job *</label>
<select id="noteJob" name="job" required class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent outline-none text-base">
<select id="noteJob" name="job" required class="w-full px-3 py-2 border-2 border-gray-300/60 rounded-xl backdrop-blur-sm bg-white/40 focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500/70 outline-none text-base transition-all shadow-sm">
<option value="">Select a job...</option>
</select>
</div>
@@ -128,7 +150,7 @@
<div>
<label for="noteSentiment" class="block text-sm font-medium text-gray-700 mb-1">Sentiment</label>
<select id="noteSentiment" name="sentiment" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent outline-none text-base">
<select id="noteSentiment" name="sentiment" class="w-full px-3 py-2 border-2 border-gray-300/60 rounded-xl backdrop-blur-sm bg-white/40 focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500/70 outline-none text-base transition-all shadow-sm">
<option value="">Select sentiment...</option>
<option value="Positive">Positive</option>
<option value="Negative">Negative</option>
@@ -138,7 +160,7 @@
<div>
<label for="noteDate" class="block text-sm font-medium text-gray-700 mb-1">Date & Time</label>
<input type="datetime-local" id="noteDate" name="date" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent outline-none text-base">
<input type="datetime-local" id="noteDate" name="date" class="w-full px-3 py-2 border-2 border-gray-300/60 rounded-xl backdrop-blur-sm bg-white/40 focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500/70 outline-none text-base transition-all shadow-sm">
</div>
<div class="flex flex-col sm:flex-row justify-end space-y-2 sm:space-y-0 sm:space-x-3 pt-4 border-t">
@@ -163,6 +185,7 @@
<script src="js/pocketbase.js"></script>
<script src="js/config.js"></script>
<script src="js/auth.js"></script>
<script src="js/preferences.js"></script>
<script src="js/jobs.js"></script>
<script src="js/notes.js"></script>
<script>
@@ -171,12 +194,43 @@
// Check authentication
checkAuth();
// Set user email
// Initialize dark mode
initializeDarkMode();
// Set user email and initials
const user = pb.authStore.model;
if (user) {
document.getElementById('userEmail').textContent = user.email || '';
const email = user.email || '';
document.getElementById('userEmail').textContent = email;
// Set initials for avatar
const initials = email
.split('@')[0]
.split('.')
.map(part => part.charAt(0).toUpperCase())
.join('')
.substring(0, 2) || 'U';
document.getElementById('userInitials').textContent = initials;
}
// Toggle user dropdown
function toggleUserDropdown() {
const dropdown = document.getElementById('userDropdown');
dropdown.classList.toggle('hidden');
}
// Close dropdown when clicking outside
document.addEventListener('click', (e) => {
const dropdown = document.getElementById('userDropdown');
const button = document.getElementById('userAvatarBtn');
if (dropdown && !dropdown.contains(e.target) && !button.contains(e.target)) {
dropdown.classList.add('hidden');
}
});
// Make function globally accessible
window.toggleUserDropdown = toggleUserDropdown;
// Initialize Quill editor
noteEditor = new Quill('#noteEditor', {
theme: 'snow',