Reports: clean up table styling, show non-URL evidence as plain text

Table cells now top-align (was baseline, which misaligned rows once a
cell wrapped to two lines - reason/evidence, timestamp, action icons
all drifted vertically against each other). Reason and evidence get
their own spacing with a subtle divider instead of a cramped <br>.
Evidence is only rendered as a clickable "Beweis-Link" when it actually
looks like a URL (http/https); otherwise it shows as plain descriptive
text with a note icon instead of a dead link.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Maaxxs 2026-09-20 02:37:38 +02:00
parent 828befceb1
commit 0dae6298af
2 changed files with 60 additions and 6 deletions

View file

@ -340,8 +340,9 @@ table {
th, td { th, td {
text-align: left; text-align: left;
padding: 0.6rem 0.75rem; padding: 0.75rem;
border-bottom: 1px solid var(--border); border-bottom: 1px solid var(--border);
vertical-align: top;
} }
th { th {
@ -364,6 +365,49 @@ tr:hover td { background: var(--bg-panel-alt); }
white-space: nowrap; white-space: nowrap;
} }
/* --- Reports-Tabelle: eigene Zellen-Bausteine statt Inline-Styles --- */
.report-reported-cell {
display: flex;
align-items: center;
gap: 0.5rem;
}
.report-time-secondary {
display: block;
margin-top: 0.2rem;
font-size: 0.78rem;
}
.report-reason {
max-width: 320px;
}
.report-reason-text {
white-space: pre-wrap;
line-height: 1.4;
}
.report-evidence {
display: flex;
align-items: center;
gap: 0.35rem;
margin-top: 0.5rem;
padding-top: 0.5rem;
border-top: 1px dashed var(--border);
font-size: 0.82rem;
color: var(--text-muted);
}
.report-evidence .icon { width: 14px; height: 14px; flex-shrink: 0; }
.report-evidence a { color: var(--gold); }
.report-evidence a:hover { color: var(--gold-hover); }
.report-evidence-text {
overflow-wrap: anywhere;
}
.text-button { .text-button {
background: none; background: none;
border: none; border: none;

View file

@ -128,9 +128,10 @@ include __DIR__ . '/includes/header.php';
$isArchived = !empty($report['archived']); $isArchived = !empty($report['archived']);
$timestamp = (int) ($report['timestamp'] ?? 0); $timestamp = (int) ($report['timestamp'] ?? 0);
?> ?>
<?php $evidenceIsLink = $evidence !== '' && preg_match('#^https?://#i', $evidence) === 1; ?>
<tr> <tr>
<td> <td>
<div style="display:flex;align-items:center;gap:0.5rem;"> <div class="report-reported-cell">
<?= avatar_html($reportedUser, 28) ?> <?= avatar_html($reportedUser, 28) ?>
<strong><?= e($reportedName) ?></strong> <strong><?= e($reportedName) ?></strong>
</div> </div>
@ -138,11 +139,20 @@ include __DIR__ . '/includes/header.php';
<td class="text-muted"><?= e($reporterName) ?></td> <td class="text-muted"><?= e($reporterName) ?></td>
<td class="text-muted"> <td class="text-muted">
<?= e($incidentTime) ?> <?= e($incidentTime) ?>
<?php if ($timestamp): ?><br><span style="font-size:0.75rem;">gemeldet: <?= date('d.m.Y H:i', $timestamp) ?></span><?php endif; ?> <?php if ($timestamp): ?><span class="report-time-secondary">gemeldet: <?= date('d.m.Y H:i', $timestamp) ?></span><?php endif; ?>
</td> </td>
<td style="max-width:320px;white-space:pre-wrap;"> <td class="report-reason">
<?= e($reason) ?> <div class="report-reason-text"><?= e($reason) ?></div>
<?php if ($evidence !== ''): ?><br><a href="<?= e($evidence) ?>" target="_blank" rel="noopener noreferrer">Beweis-Link</a><?php endif; ?> <?php if ($evidence !== ''): ?>
<div class="report-evidence">
<?= icon($evidenceIsLink ? 'link' : 'edit') ?>
<?php if ($evidenceIsLink): ?>
<a href="<?= e($evidence) ?>" target="_blank" rel="noopener noreferrer">Beweis-Link</a>
<?php else: ?>
<span class="report-evidence-text"><?= e($evidence) ?></span>
<?php endif; ?>
</div>
<?php endif; ?>
</td> </td>
<td><span class="badge"><?= $points ?> Pkt.</span></td> <td><span class="badge"><?= $points ?> Pkt.</span></td>
<td> <td>