Feature: Split-View in Belegliste mit Vorschau-Panel rechts
This commit is contained in:
parent
4fb0b21a90
commit
134ac84bb2
1 changed files with 122 additions and 66 deletions
|
|
@ -126,6 +126,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div style="display:flex;gap:1rem;align-items:flex-start">
|
||||||
|
|
||||||
|
<!-- Linke Hälfte: Tabelle + Pagination -->
|
||||||
|
<div style="flex:1;min-width:0">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="table-wrap">
|
<div class="table-wrap">
|
||||||
<table>
|
<table>
|
||||||
|
|
@ -144,8 +148,13 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($rows as $b): ?>
|
<?php foreach ($rows as $b): ?>
|
||||||
<tr>
|
<tr class="beleg-row"
|
||||||
<td><a href="/belege/<?= $h($b['id']) ?>" class="font-mono"><?= $h($b['beleg_nr']) ?></a></td>
|
data-beleg-id="<?= (int)$b['id'] ?>"
|
||||||
|
style="cursor:pointer"
|
||||||
|
title="Klicken für Vorschau">
|
||||||
|
<td onclick="event.stopPropagation()">
|
||||||
|
<a href="/belege/<?= $h($b['id']) ?>" class="font-mono"><?= $h($b['beleg_nr']) ?></a>
|
||||||
|
</td>
|
||||||
<td class="td-muted"><?= View::formatDate($b['beleg_datum']) ?></td>
|
<td class="td-muted"><?= View::formatDate($b['beleg_datum']) ?></td>
|
||||||
<td class="td-muted"><?= $h($b['supplier_name'] ?? '–') ?></td>
|
<td class="td-muted"><?= $h($b['supplier_name'] ?? '–') ?></td>
|
||||||
<td class="td-muted"><?= $h($b['rechnungs_nr'] ?? '–') ?></td>
|
<td class="td-muted"><?= $h($b['rechnungs_nr'] ?? '–') ?></td>
|
||||||
|
|
@ -171,7 +180,7 @@
|
||||||
<span class="badge badge-yellow">Offen</span>
|
<span class="badge badge-yellow">Offen</span>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td onclick="event.stopPropagation()">
|
||||||
<a href="/belege/<?= $h($b['id']) ?>" class="btn btn-secondary btn-sm">Öffnen</a>
|
<a href="/belege/<?= $h($b['id']) ?>" class="btn btn-secondary btn-sm">Öffnen</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -197,3 +206,50 @@
|
||||||
<?php if ($page < $pages): ?><a href="?<?= http_build_query(array_merge($filter, ['page' => $page+1])) ?>">›</a><?php endif; ?>
|
<?php if ($page < $pages): ?><a href="?<?= http_build_query(array_merge($filter, ['page' => $page+1])) ?>">›</a><?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Rechte Hälfte: Vorschau-Panel -->
|
||||||
|
<div id="beleg-preview-panel" style="
|
||||||
|
flex:1;
|
||||||
|
min-width:0;
|
||||||
|
position:sticky;
|
||||||
|
top:1rem;
|
||||||
|
border:1px solid var(--color-border,#e2e8f0);
|
||||||
|
border-radius:var(--radius,6px);
|
||||||
|
background:var(--color-surface,#f8fafc);
|
||||||
|
overflow:hidden;
|
||||||
|
height:calc(100vh - 6rem);
|
||||||
|
display:flex;
|
||||||
|
align-items:center;
|
||||||
|
justify-content:center;
|
||||||
|
">
|
||||||
|
<span class="text-muted text-sm" id="beleg-preview-hint">Zeile anklicken für Vorschau</span>
|
||||||
|
<iframe id="beleg-preview-frame"
|
||||||
|
style="display:none;width:100%;height:100%;border:none"
|
||||||
|
src=""></iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
(function () {
|
||||||
|
const frame = document.getElementById('beleg-preview-frame');
|
||||||
|
const hint = document.getElementById('beleg-preview-hint');
|
||||||
|
let activeRow = null;
|
||||||
|
|
||||||
|
document.querySelectorAll('.beleg-row').forEach(function (row) {
|
||||||
|
row.addEventListener('click', function () {
|
||||||
|
const id = row.dataset.belegId;
|
||||||
|
if (!id) return;
|
||||||
|
|
||||||
|
if (activeRow) activeRow.style.background = '';
|
||||||
|
activeRow = row;
|
||||||
|
row.style.background = 'var(--color-primary-light, #eff6ff)';
|
||||||
|
|
||||||
|
hint.style.display = 'none';
|
||||||
|
frame.style.display = 'block';
|
||||||
|
frame.src = '/belege/' + id + '/file';
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue