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

@@ -27,24 +27,86 @@
</script>
</head>
<body>
<div class="user-header" style="background: #2c3e50; padding: 0.75rem 2rem; color: white; display: flex; justify-content: space-between; align-items: center;">
<div>
<a href="/" style="color: white; text-decoration: none; font-weight: bold;">← Dashboard</a>
<div class="user-header">
<div class="user-header-left">
<a href="/" class="back-link">← Dashboard</a>
</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;
}
.back-link {
color: var(--header-text);
text-decoration: none;
font-weight: bold;
}
.back-link:hover {
text-decoration: underline;
}
.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="ticket-container" data-priority="<?php echo $ticket["priority"]; ?>">
<div class="ticket-header">
<h2><input type="text" class="editable title-input" value="<?php echo htmlspecialchars($ticket["title"]); ?>" data-field="title" disabled></h2>
<div class="ticket-subheader">
<div class="ticket-id">UUID <?php echo $ticket['ticket_id']; ?></div>
<div class="ticket-metadata">
<div class="ticket-id">UUID <?php echo $ticket['ticket_id']; ?></div>
<div class="ticket-user-info" style="font-size: 0.85rem; color: #666; margin-top: 0.25rem;">
<?php
$creator = $ticket['creator_display_name'] ?? $ticket['creator_username'] ?? 'System';
echo "Created by: <strong>" . htmlspecialchars($creator) . "</strong>";
if (!empty($ticket['created_at'])) {
echo " on " . date('M d, Y H:i', strtotime($ticket['created_at']));
}
if (!empty($ticket['updater_display_name']) || !empty($ticket['updater_username'])) {
$updater = $ticket['updater_display_name'] ?? $ticket['updater_username'];
echo " • Last updated by: <strong>" . htmlspecialchars($updater) . "</strong>";
if (!empty($ticket['updated_at'])) {
echo " on " . date('M d, Y H:i', strtotime($ticket['updated_at']));
}
}
?>
</div>
</div>
<div class="header-controls">
<div class="status-priority-group">
<span id="statusDisplay" class="status-<?php echo str_replace(' ', '-', $ticket["status"]); ?>"><?php echo $ticket["status"]; ?></span>