Switch to responsive card layout below 1400px for dashboard
Major improvements: - Replace table with card-based layout below 1400px width - Cards show ticket ID, title, category, assignee, status, and actions - Priority indicated by left border color - Fully responsive from 1400px down to mobile Mobile improvements (768px and below): - Cards stack vertically with touch-friendly sizing - Action buttons are full-width with 44px touch targets - Meta info displayed in a clean row format - Removed old table-based mobile styles Sidebar collapse improvements: - Collapsed state now truly saves space (0 width, no gap) - Expand button is compact vertical text Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -520,7 +520,7 @@ h1 {
|
||||
|
||||
/* ===== INTERMEDIATE RESPONSIVE BREAKPOINTS ===== */
|
||||
|
||||
/* Extra large desktop (1600px+) */
|
||||
/* Extra large desktop (1600px+) - Full table view */
|
||||
@media (min-width: 1600px) {
|
||||
.dashboard-layout {
|
||||
max-width: 1800px;
|
||||
@@ -536,8 +536,8 @@ h1 {
|
||||
}
|
||||
}
|
||||
|
||||
/* Large desktop (1200px - 1599px) - Hide some columns to fit */
|
||||
@media (min-width: 1200px) and (max-width: 1599px) {
|
||||
/* Large desktop (1400px - 1599px) - Slightly compact table */
|
||||
@media (min-width: 1400px) and (max-width: 1599px) {
|
||||
.dashboard-layout {
|
||||
max-width: 100%;
|
||||
padding: 0 0.5rem;
|
||||
@@ -558,23 +558,136 @@ h1 {
|
||||
th, td {
|
||||
padding: 8px 10px;
|
||||
}
|
||||
|
||||
/* Hide less important columns on medium-large screens */
|
||||
table th:nth-child(8),
|
||||
table td:nth-child(8),
|
||||
table th:nth-child(10),
|
||||
table td:nth-child(10) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Medium-large desktop (1000px - 1199px) - Hide more columns */
|
||||
@media (min-width: 1000px) and (max-width: 1199px) {
|
||||
.dashboard-layout {
|
||||
max-width: 100%;
|
||||
padding: 0 0.5rem;
|
||||
/* ===== RESPONSIVE CARD VIEW (below 1400px) ===== */
|
||||
/* Switch from table to card layout for better usability */
|
||||
|
||||
@media (max-width: 1399px) {
|
||||
/* Hide the table on smaller screens */
|
||||
.table-wrapper table {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Show card view instead */
|
||||
.table-wrapper {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Card-based ticket list */
|
||||
.table-wrapper::before {
|
||||
content: 'Tickets';
|
||||
display: block;
|
||||
font-family: var(--font-mono);
|
||||
font-size: 1rem;
|
||||
color: var(--terminal-amber);
|
||||
text-shadow: var(--glow-amber);
|
||||
padding: 0.75rem 1rem;
|
||||
border-bottom: 2px solid var(--terminal-green);
|
||||
background: var(--bg-primary);
|
||||
}
|
||||
|
||||
.ticket-cards {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
.ticket-card-row {
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr auto auto;
|
||||
gap: 1rem;
|
||||
align-items: center;
|
||||
padding: 0.75rem 1rem;
|
||||
background: var(--bg-secondary);
|
||||
border: 1px solid var(--terminal-green);
|
||||
border-left: 4px solid var(--terminal-green);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.ticket-card-row:hover {
|
||||
background: rgba(0, 255, 65, 0.1);
|
||||
box-shadow: var(--glow-green);
|
||||
}
|
||||
|
||||
.ticket-card-row.priority-1 { border-left-color: var(--priority-1); }
|
||||
.ticket-card-row.priority-2 { border-left-color: var(--priority-2); }
|
||||
.ticket-card-row.priority-3 { border-left-color: var(--priority-3); }
|
||||
.ticket-card-row.priority-4 { border-left-color: var(--priority-4); }
|
||||
.ticket-card-row.priority-5 { border-left-color: var(--priority-5); }
|
||||
|
||||
.ticket-card-id {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.85rem;
|
||||
color: var(--terminal-cyan);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.ticket-card-id a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.ticket-card-id a:hover {
|
||||
color: var(--terminal-amber);
|
||||
text-shadow: var(--glow-amber);
|
||||
}
|
||||
|
||||
.ticket-card-main {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.ticket-card-title {
|
||||
font-size: 0.95rem;
|
||||
color: var(--terminal-green);
|
||||
margin-bottom: 0.25rem;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.ticket-card-meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
font-size: 0.75rem;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.ticket-card-meta span {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.ticket-card-status {
|
||||
padding: 0.25rem 0.5rem;
|
||||
font-size: 0.75rem;
|
||||
font-family: var(--font-mono);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.ticket-card-actions {
|
||||
display: flex;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.ticket-card-actions button {
|
||||
padding: 0.4rem;
|
||||
min-width: 32px;
|
||||
min-height: 32px;
|
||||
background: transparent;
|
||||
border: 1px solid var(--terminal-green);
|
||||
color: var(--terminal-green);
|
||||
cursor: pointer;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.ticket-card-actions button:hover {
|
||||
background: var(--terminal-green);
|
||||
color: var(--bg-primary);
|
||||
}
|
||||
|
||||
/* Sidebar adjustments */
|
||||
.dashboard-sidebar {
|
||||
width: 200px;
|
||||
}
|
||||
@@ -582,69 +695,52 @@ h1 {
|
||||
.stats-widgets .stats-row {
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
table {
|
||||
font-size: 0.8rem;
|
||||
/* Tablet view (900px - 1399px) */
|
||||
@media (min-width: 900px) and (max-width: 1399px) {
|
||||
.dashboard-layout {
|
||||
gap: 1rem;
|
||||
padding: 0 0.5rem;
|
||||
}
|
||||
|
||||
th, td {
|
||||
padding: 6px 8px;
|
||||
}
|
||||
|
||||
/* Hide more columns on medium screens */
|
||||
table th:nth-child(5),
|
||||
table td:nth-child(5),
|
||||
table th:nth-child(8),
|
||||
table td:nth-child(8),
|
||||
table th:nth-child(9),
|
||||
table td:nth-child(9),
|
||||
table th:nth-child(10),
|
||||
table td:nth-child(10) {
|
||||
display: none;
|
||||
.ticket-card-row {
|
||||
grid-template-columns: auto 1fr auto auto;
|
||||
}
|
||||
}
|
||||
|
||||
/* Medium desktop (900px - 999px) */
|
||||
@media (min-width: 900px) and (max-width: 999px) {
|
||||
.stats-widgets .stats-row {
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
}
|
||||
|
||||
.dashboard-toolbar {
|
||||
flex-wrap: wrap;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.toolbar-center {
|
||||
order: 3;
|
||||
width: 100%;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
/* Small tablet (600px - 899px) */
|
||||
@media (min-width: 600px) and (max-width: 899px) {
|
||||
.dashboard-sidebar {
|
||||
width: 180px;
|
||||
}
|
||||
|
||||
table {
|
||||
font-size: 0.8rem;
|
||||
.stats-widgets .stats-row {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
|
||||
th, td {
|
||||
padding: 6px 8px;
|
||||
.ticket-card-row {
|
||||
grid-template-columns: 1fr auto;
|
||||
grid-template-rows: auto auto;
|
||||
}
|
||||
|
||||
/* Hide even more columns */
|
||||
table th:nth-child(4),
|
||||
table td:nth-child(4),
|
||||
table th:nth-child(5),
|
||||
table td:nth-child(5),
|
||||
table th:nth-child(8),
|
||||
table td:nth-child(8),
|
||||
table th:nth-child(9),
|
||||
table td:nth-child(9),
|
||||
table th:nth-child(10),
|
||||
table td:nth-child(10) {
|
||||
display: none;
|
||||
.ticket-card-id {
|
||||
grid-column: 1;
|
||||
grid-row: 1;
|
||||
}
|
||||
|
||||
.ticket-card-main {
|
||||
grid-column: 1 / -1;
|
||||
grid-row: 2;
|
||||
}
|
||||
|
||||
.ticket-card-status {
|
||||
grid-column: 2;
|
||||
grid-row: 1;
|
||||
}
|
||||
|
||||
.ticket-card-actions {
|
||||
display: none; /* Hide on small tablets, access via tap */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1470,6 +1566,18 @@ button:active {
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
/* ===== RESPONSIVE TICKET CARDS - Hidden on desktop ===== */
|
||||
.ticket-cards {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ticket-card-empty {
|
||||
padding: 3rem;
|
||||
text-align: center;
|
||||
color: var(--terminal-green);
|
||||
font-family: var(--font-mono);
|
||||
}
|
||||
|
||||
/* ===== TABLE STYLES - TERMINAL EDITION ===== */
|
||||
table {
|
||||
width: 100%;
|
||||
@@ -5140,7 +5248,7 @@ table td:nth-child(4) {
|
||||
display: none; /* Hide pagination in toolbar - show at bottom */
|
||||
}
|
||||
|
||||
/* ===== TABLE WRAPPER ===== */
|
||||
/* ===== TICKET CARDS - Mobile optimized ===== */
|
||||
.ascii-frame-outer {
|
||||
margin: 0.5rem 0;
|
||||
border-width: 2px;
|
||||
@@ -5162,43 +5270,73 @@ table td:nth-child(4) {
|
||||
|
||||
.table-wrapper {
|
||||
width: 100%;
|
||||
overflow-x: visible;
|
||||
}
|
||||
|
||||
.table-wrapper table {
|
||||
min-width: auto;
|
||||
/* Hide the ::before header on mobile - we use a simpler one */
|
||||
.table-wrapper::before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Mobile-optimized card layout */
|
||||
.ticket-cards {
|
||||
padding: 0.25rem;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.ticket-card-row {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
padding: 0.75rem;
|
||||
border-left-width: 4px;
|
||||
}
|
||||
|
||||
.ticket-card-id {
|
||||
font-size: 0.9rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.ticket-card-id a {
|
||||
display: inline-block;
|
||||
padding: 0.25rem 0;
|
||||
min-height: 44px;
|
||||
line-height: 2;
|
||||
}
|
||||
|
||||
.ticket-card-main {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
table {
|
||||
.ticket-card-title {
|
||||
font-size: 1rem;
|
||||
line-height: 1.4;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.ticket-card-meta {
|
||||
font-size: 0.8rem;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.ticket-card-status {
|
||||
align-self: flex-start;
|
||||
padding: 0.35rem 0.75rem;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
table th,
|
||||
table td {
|
||||
padding: 0.75rem 0.5rem;
|
||||
white-space: normal;
|
||||
word-wrap: break-word;
|
||||
.ticket-card-actions {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
margin-top: 0.5rem;
|
||||
padding-top: 0.5rem;
|
||||
border-top: 1px solid rgba(0, 255, 65, 0.2);
|
||||
}
|
||||
|
||||
/* Make ticket ID and title columns wider */
|
||||
table th:nth-child(1),
|
||||
table td:nth-child(1) {
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
table th:nth-child(3),
|
||||
table td:nth-child(3) {
|
||||
min-width: 200px;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
/* Link touch targets */
|
||||
table td a {
|
||||
display: inline-block;
|
||||
padding: 0.5rem 0;
|
||||
.ticket-card-actions button {
|
||||
flex: 1;
|
||||
min-height: 44px;
|
||||
line-height: 1.5;
|
||||
padding: 0.5rem;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
/* ===== BULK ACTIONS ===== */
|
||||
|
||||
@@ -12,11 +12,11 @@ $nonce = SecurityHeadersMiddleware::getNonce();
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Ticket Dashboard</title>
|
||||
<link rel="icon" type="image/png" href="<?php echo $GLOBALS['config']['ASSETS_URL']; ?>/images/favicon.png">
|
||||
<link rel="stylesheet" href="<?php echo $GLOBALS['config']['ASSETS_URL']; ?>/css/dashboard.css?v=20260131b">
|
||||
<link rel="stylesheet" href="<?php echo $GLOBALS['config']['ASSETS_URL']; ?>/css/dashboard.css?v=20260131c">
|
||||
<script nonce="<?php echo $nonce; ?>" src="<?php echo $GLOBALS['config']['ASSETS_URL']; ?>/js/ascii-banner.js"></script>
|
||||
<script nonce="<?php echo $nonce; ?>" src="<?php echo $GLOBALS['config']['ASSETS_URL']; ?>/js/toast.js"></script>
|
||||
<script nonce="<?php echo $nonce; ?>" src="<?php echo $GLOBALS['config']['ASSETS_URL']; ?>/js/markdown.js?v=20260131b"></script>
|
||||
<script nonce="<?php echo $nonce; ?>" src="<?php echo $GLOBALS['config']['ASSETS_URL']; ?>/js/dashboard.js?v=20260131b"></script>
|
||||
<script nonce="<?php echo $nonce; ?>" src="<?php echo $GLOBALS['config']['ASSETS_URL']; ?>/js/markdown.js?v=20260131c"></script>
|
||||
<script nonce="<?php echo $nonce; ?>" src="<?php echo $GLOBALS['config']['ASSETS_URL']; ?>/js/dashboard.js?v=20260131c"></script>
|
||||
<script nonce="<?php echo $nonce; ?>">
|
||||
// CSRF Token for AJAX requests
|
||||
window.CSRF_TOKEN = '<?php echo CsrfMiddleware::getToken(); ?>';
|
||||
@@ -489,6 +489,48 @@ $nonce = SecurityHeadersMiddleware::getNonce();
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- Responsive Card View (shown on smaller screens via CSS) -->
|
||||
<div class="ticket-cards">
|
||||
<?php
|
||||
if (count($tickets) > 0) {
|
||||
foreach($tickets as $row) {
|
||||
$creator = $row['creator_display_name'] ?? $row['creator_username'] ?? 'System';
|
||||
$assignedTo = $row['assigned_display_name'] ?? $row['assigned_username'] ?? 'Unassigned';
|
||||
$statusClass = 'status-' . str_replace(' ', '-', $row['status']);
|
||||
?>
|
||||
<div class="ticket-card-row priority-<?php echo $row['priority']; ?>">
|
||||
<div class="ticket-card-id">
|
||||
<a href="/ticket/<?php echo $row['ticket_id']; ?>">#<?php echo $row['ticket_id']; ?></a>
|
||||
</div>
|
||||
<div class="ticket-card-main">
|
||||
<div class="ticket-card-title"><?php echo htmlspecialchars($row['title']); ?></div>
|
||||
<div class="ticket-card-meta">
|
||||
<span>📁 <?php echo htmlspecialchars($row['category']); ?></span>
|
||||
<span>👤 <?php echo htmlspecialchars($assignedTo); ?></span>
|
||||
<span>📅 <?php echo date('M j', strtotime($row['updated_at'])); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ticket-card-status <?php echo $statusClass; ?>">
|
||||
<?php echo $row['status']; ?>
|
||||
</div>
|
||||
<div class="ticket-card-actions">
|
||||
<button data-action="view-ticket" data-ticket-id="<?php echo $row['ticket_id']; ?>" title="View">👁</button>
|
||||
<button data-action="quick-status" data-ticket-id="<?php echo $row['ticket_id']; ?>" data-status="<?php echo $row['status']; ?>" title="Status">🔄</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<div class="ticket-card-empty">
|
||||
<span>No tickets found</span>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div><!-- End table-wrapper -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user