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:
parent
828befceb1
commit
0dae6298af
2 changed files with 60 additions and 6 deletions
|
|
@ -340,8 +340,9 @@ table {
|
|||
|
||||
th, td {
|
||||
text-align: left;
|
||||
padding: 0.6rem 0.75rem;
|
||||
padding: 0.75rem;
|
||||
border-bottom: 1px solid var(--border);
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
th {
|
||||
|
|
@ -364,6 +365,49 @@ tr:hover td { background: var(--bg-panel-alt); }
|
|||
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 {
|
||||
background: none;
|
||||
border: none;
|
||||
|
|
|
|||
20
reports.php
20
reports.php
|
|
@ -128,9 +128,10 @@ include __DIR__ . '/includes/header.php';
|
|||
$isArchived = !empty($report['archived']);
|
||||
$timestamp = (int) ($report['timestamp'] ?? 0);
|
||||
?>
|
||||
<?php $evidenceIsLink = $evidence !== '' && preg_match('#^https?://#i', $evidence) === 1; ?>
|
||||
<tr>
|
||||
<td>
|
||||
<div style="display:flex;align-items:center;gap:0.5rem;">
|
||||
<div class="report-reported-cell">
|
||||
<?= avatar_html($reportedUser, 28) ?>
|
||||
<strong><?= e($reportedName) ?></strong>
|
||||
</div>
|
||||
|
|
@ -138,11 +139,20 @@ include __DIR__ . '/includes/header.php';
|
|||
<td class="text-muted"><?= e($reporterName) ?></td>
|
||||
<td class="text-muted">
|
||||
<?= 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 style="max-width:320px;white-space:pre-wrap;">
|
||||
<?= e($reason) ?>
|
||||
<?php if ($evidence !== ''): ?><br><a href="<?= e($evidence) ?>" target="_blank" rel="noopener noreferrer">Beweis-Link</a><?php endif; ?>
|
||||
<td class="report-reason">
|
||||
<div class="report-reason-text"><?= e($reason) ?></div>
|
||||
<?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><span class="badge"><?= $points ?> Pkt.</span></td>
|
||||
<td>
|
||||
|
|
|
|||
Loading…
Reference in a new issue