Username not live updating & css overlap bug

This commit is contained in:
2026-01-01 16:14:56 -05:00
parent 7b25ec1dd1
commit b8a0fb011f
4 changed files with 132 additions and 16 deletions

View File

@@ -13,19 +13,60 @@
<script src="<?php echo $GLOBALS['config']['ASSETS_URL']; ?>/js/dashboard.js"></script>
</head>
<body data-categories='<?php echo json_encode($categories); ?>' data-types='<?php echo json_encode($types); ?>'>
<div class="user-header" style="background: #2c3e50; padding: 0.75rem 2rem; color: white; display: flex; justify-content: space-between; align-items: center;">
<div>
<span style="font-weight: bold; font-size: 1.1rem;">🎫 Tinker Tickets</span>
<div class="user-header">
<div class="user-header-left">
<span class="app-title">🎫 Tinker Tickets</span>
</div>
<div style="display: flex; align-items: center; gap: 1rem;">
<div class="user-header-right">
<?php if (isset($GLOBALS['currentUser'])): ?>
<span>👤 <?php echo htmlspecialchars($GLOBALS['currentUser']['display_name'] ?? $GLOBALS['currentUser']['username']); ?></span>
<span class="user-name">👤 <?php echo htmlspecialchars($GLOBALS['currentUser']['display_name'] ?? $GLOBALS['currentUser']['username']); ?></span>
<?php if ($GLOBALS['currentUser']['is_admin']): ?>
<span style="background: #e74c3c; padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.85rem;">Admin</span>
<span class="admin-badge">Admin</span>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
<style>
.user-header {
background: var(--header-bg, #2c3e50);
padding: 0.75rem 2rem;
color: var(--header-text, white);
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid var(--border-color, #ddd);
}
body.light-mode .user-header {
--header-bg: #f8f9fa;
--header-text: #333;
--border-color: #dee2e6;
}
body.dark-mode .user-header {
--header-bg: #2c3e50;
--header-text: white;
--border-color: #444;
}
.user-header-left, .user-header-right {
display: flex;
align-items: center;
gap: 1rem;
}
.app-title {
font-weight: bold;
font-size: 1.1rem;
color: var(--header-text);
}
.user-name {
color: var(--header-text);
}
.admin-badge {
background: #e74c3c;
color: white;
padding: 0.25rem 0.5rem;
border-radius: 4px;
font-size: 0.85rem;
}
</style>
<div class="dashboard-header">
<h1>Ticket Dashboard</h1>
<button onclick="window.location.href='<?php echo $GLOBALS['config']['BASE_URL']; ?>/ticket/create'" class="btn create-ticket">New Ticket</button> </div>