Reports: replace the table with a styled card list

The dense table row (avatar, name, time, reason/evidence, badges,
actions all crammed into one baseline-misaligned line) is now a
stacked list of report cards, matching the panel/avatar-chip language
used elsewhere on the site: a colored left border for quick status
scanning (green = active, muted = archived, gold on hover with a
slight lift), a header row with a 40px avatar and reporter subtitle,
reason/evidence in their own section, and a footer row for the
incident timestamp and the archive/delete actions.

Verified the user-filter dropdown still layers correctly above the new
cards, since each card now also uses backdrop-filter (same stacking-
context concern fixed previously via .panel-filter-bar's z-index).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Maaxxs 2026-09-20 02:56:32 +02:00
parent 6333e0533d
commit c720b0173d
3 changed files with 155 additions and 93 deletions

View file

@ -365,35 +365,97 @@ tr:hover td { background: var(--bg-panel-alt); }
white-space: nowrap; white-space: nowrap;
} }
/* --- Reports-Tabelle: eigene Zellen-Bausteine statt Inline-Styles --- */ /* --- Reports: Kartenliste statt Tabelle --- */
.report-reported-cell { .report-list {
display: flex;
flex-direction: column;
gap: 0.85rem;
}
.report-card {
background: rgba(35, 35, 35, 0.62);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
border: 1px solid var(--border);
border-left-width: 3px;
border-left-color: var(--success);
border-radius: 10px;
padding: 1.1rem 1.35rem;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.report-card:hover {
border-top-color: var(--gold);
border-right-color: var(--gold);
border-bottom-color: var(--gold);
transform: translateY(-2px);
box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}
.report-card-archived {
border-left-color: var(--text-muted);
opacity: 0.7;
}
.report-card-archived:hover { opacity: 0.95; }
.report-card-main {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
flex-wrap: wrap;
}
.report-card-user {
display: flex;
align-items: center;
gap: 0.75rem;
min-width: 0;
}
.report-card-user-info {
display: flex;
flex-direction: column;
gap: 0.1rem;
min-width: 0;
}
.report-card-user-info strong {
font-size: 1.05rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.report-card-user-info .text-muted { font-size: 0.82rem; }
.report-card-badges {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 0.5rem; gap: 0.5rem;
flex-shrink: 0;
} }
.report-time-secondary { .report-card-body {
display: block; margin-top: 0.9rem;
margin-top: 0.2rem; padding-top: 0.9rem;
font-size: 0.78rem; border-top: 1px dashed var(--border);
}
.report-reason {
max-width: 320px;
} }
.report-reason-text { .report-reason-text {
white-space: pre-wrap; white-space: pre-wrap;
line-height: 1.4; line-height: 1.45;
} }
.report-evidence { .report-evidence {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 0.35rem; gap: 0.4rem;
margin-top: 0.5rem; margin-top: 0.6rem;
padding-top: 0.5rem; padding-top: 0.6rem;
border-top: 1px dashed var(--border); border-top: 1px dashed var(--border);
font-size: 0.82rem; font-size: 0.82rem;
color: var(--text-muted); color: var(--text-muted);
@ -408,6 +470,18 @@ tr:hover td { background: var(--bg-panel-alt); }
overflow-wrap: anywhere; overflow-wrap: anywhere;
} }
.report-card-footer {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
flex-wrap: wrap;
margin-top: 0.9rem;
padding-top: 0.8rem;
border-top: 1px solid var(--border);
font-size: 0.8rem;
}
.text-button { .text-button {
background: none; background: none;
border: none; border: none;

View file

@ -129,7 +129,7 @@
var triggerContent = document.getElementById('report-user-filter-trigger-content'); var triggerContent = document.getElementById('report-user-filter-trigger-content');
var panel = document.getElementById('report-user-filter-panel'); var panel = document.getElementById('report-user-filter-panel');
var options = panel ? panel.querySelectorAll('.user-filter-option') : []; var options = panel ? panel.querySelectorAll('.user-filter-option') : [];
var rows = document.querySelectorAll('.report-row'); var rows = document.querySelectorAll('.report-card');
var emptyMessage = document.getElementById('report-filter-empty'); var emptyMessage = document.getElementById('report-filter-empty');
if (!wrapper || !trigger || !panel || !options.length || !rows.length) return; if (!wrapper || !trigger || !panel || !options.length || !rows.length) return;

View file

@ -146,21 +146,7 @@ include __DIR__ . '/includes/header.php';
<p class="text-muted"><?= e($emptyLabels[$status]) ?></p> <p class="text-muted"><?= e($emptyLabels[$status]) ?></p>
</div> </div>
<?php else: ?> <?php else: ?>
<div class="panel"> <div class="report-list">
<div class="table-scroll">
<table>
<thead>
<tr>
<th>Gemeldet</th>
<th>Melder</th>
<th>Zeitpunkt</th>
<th>Grund</th>
<th>Punkte</th>
<th>Status</th>
<?php if ($canManageReports): ?><th></th><?php endif; ?>
</tr>
</thead>
<tbody>
<?php foreach ($reports as $report): ?> <?php foreach ($reports as $report): ?>
<?php <?php
$reportId = (int) ($report['report_id'] ?? 0); $reportId = (int) ($report['report_id'] ?? 0);
@ -175,21 +161,28 @@ include __DIR__ . '/includes/header.php';
$points = (int) ($report['points'] ?? 1); $points = (int) ($report['points'] ?? 1);
$isArchived = !empty($report['archived']); $isArchived = !empty($report['archived']);
$timestamp = (int) ($report['timestamp'] ?? 0); $timestamp = (int) ($report['timestamp'] ?? 0);
$evidenceIsLink = $evidence !== '' && preg_match('#^https?://#i', $evidence) === 1;
?> ?>
<?php $evidenceIsLink = $evidence !== '' && preg_match('#^https?://#i', $evidence) === 1; ?> <div class="report-card<?= $isArchived ? ' report-card-archived' : '' ?>" data-reported-id="<?= $reportedId ?>">
<tr class="report-row" data-reported-id="<?= $reportedId ?>"> <div class="report-card-main">
<td> <div class="report-card-user">
<div class="report-reported-cell"> <?= avatar_html($reportedUser, 40) ?>
<?= avatar_html($reportedUser, 28) ?> <div class="report-card-user-info">
<strong><?= e($reportedName) ?></strong> <strong><?= e($reportedName) ?></strong>
<span class="text-muted">gemeldet von <?= e($reporterName) ?></span>
</div> </div>
</td> </div>
<td class="text-muted"><?= e($reporterName) ?></td> <div class="report-card-badges">
<td class="text-muted"> <span class="badge"><?= $points ?> Pkt.</span>
<?= e($incidentTime) ?> <?php if ($isArchived): ?>
<?php if ($timestamp): ?><span class="report-time-secondary">gemeldet: <?= date('d.m.Y H:i', $timestamp) ?></span><?php endif; ?> <span class="badge badge-disabled">Archiviert</span>
</td> <?php else: ?>
<td class="report-reason"> <span class="badge badge-active">Aktiv</span>
<?php endif; ?>
</div>
</div>
<div class="report-card-body">
<div class="report-reason-text"><?= e($reason) ?></div> <div class="report-reason-text"><?= e($reason) ?></div>
<?php if ($evidence !== ''): ?> <?php if ($evidence !== ''): ?>
<div class="report-evidence"> <div class="report-evidence">
@ -201,17 +194,14 @@ include __DIR__ . '/includes/header.php';
<?php endif; ?> <?php endif; ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
</td> </div>
<td><span class="badge"><?= $points ?> Pkt.</span></td>
<td> <div class="report-card-footer">
<?php if ($isArchived): ?> <span class="text-muted">
<span class="badge badge-disabled">Archiviert</span> Vorfall: <?= e($incidentTime) ?><?php if ($timestamp): ?> · gemeldet <?= date('d.m.Y H:i', $timestamp) ?><?php endif; ?>
<?php else: ?> </span>
<span class="badge badge-active">Aktiv</span>
<?php endif; ?>
</td>
<?php if ($canManageReports): ?> <?php if ($canManageReports): ?>
<td class="actions"> <div class="actions">
<form method="post" action="/report_action.php" class="inline-form"> <form method="post" action="/report_action.php" class="inline-form">
<?= csrf_field() ?> <?= csrf_field() ?>
<input type="hidden" name="report_id" value="<?= $reportId ?>"> <input type="hidden" name="report_id" value="<?= $reportId ?>">
@ -224,15 +214,13 @@ include __DIR__ . '/includes/header.php';
<input type="hidden" name="action" value="delete"> <input type="hidden" name="action" value="delete">
<button type="submit" class="icon-button icon-button-danger" title="Löschen"><?= icon('trash') ?></button> <button type="submit" class="icon-button icon-button-danger" title="Löschen"><?= icon('trash') ?></button>
</form> </form>
</td> </div>
<?php endif; ?> <?php endif; ?>
</tr> </div>
</div>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </div>
</table>
<p class="text-muted" id="report-filter-empty" hidden>Keine Reports passen zum Filter.</p> <p class="text-muted" id="report-filter-empty" hidden>Keine Reports passen zum Filter.</p>
</div>
</div>
<?php endif; ?> <?php endif; ?>
<?php if ($canManageReports): ?> <?php if ($canManageReports): ?>