Fix: UI/UX Verbesserungen und Critical Fix
All checks were successful
Docker Build & Push / build-and-push (push) Successful in 23s

- add_packing_list.php: Critical Fix für Browser-Freeze (MutationObserver ersetzt).
- packing_list_detail.php: Chart-Design optimiert (Kontrast, Rahmen entfernt).
- backpacks.php: Button-Farbe angepasst.
- README.md: Changelog aktualisiert.
This commit is contained in:
Gemini Agent
2025-12-06 16:40:58 +00:00
parent 1c13862640
commit c1f4ec1de7
4 changed files with 15 additions and 22 deletions

View File

@@ -239,27 +239,18 @@ document.addEventListener('DOMContentLoaded', function() {
}
}
// Observe changes.
// The modal script updates the hidden input. We can listen to a custom event or use MutationObserver.
// Or simply listen to clicks on the "Select" buttons in the modal, but the modal logic is separate.
// However, the `render_backpack_modal_script` updates the UI and the hidden input.
// We can attach a MutationObserver to the form to detect value changes or DOM changes in the backpack cards.
const observer = new MutationObserver(function(mutations) {
validateBackpacks();
});
observer.observe(document.querySelector('.card-body'), {
subtree: true,
attributes: true, // value change might not trigger attribute change in DOM for inputs, but innerHTML changes of cards do
childList: true
});
// Also listen to participation checkboxes
document.querySelectorAll('.participation-check').forEach(chk => {
chk.addEventListener('change', validateBackpacks);
});
// Listen for modal close/hide events (bootstrap specific) to re-validate
// Since the backpack selection happens in a modal, validating on modal hide is efficient.
// We use event delegation or attach to body since modals might be dynamically inserted/removed (though here they are static in footer usually)
document.body.addEventListener('hidden.bs.modal', function (event) {
validateBackpacks();
});
// Initial check
validateBackpacks();
});

View File

@@ -126,7 +126,7 @@ while ($row = $result->fetch_assoc()) {
<div class="card-footer bg-transparent border-top-0 d-flex justify-content-between align-items-center gap-2">
<div>
<?php if (!empty($bp['product_url'])): ?>
<a href="<?php echo htmlspecialchars($bp['product_url']); ?>" target="_blank" class="btn btn-sm btn-outline-info" title="Herstellerseite öffnen"><i class="fas fa-external-link-alt"></i> Info</a>
<a href="<?php echo htmlspecialchars($bp['product_url']); ?>" target="_blank" class="btn btn-sm btn-outline-success" title="Herstellerseite öffnen"><i class="fas fa-external-link-alt"></i> Info</a>
<?php endif; ?>
</div>

View File

@@ -416,12 +416,12 @@ document.addEventListener('DOMContentLoaded', function() {
const catCtx = document.getElementById('categoryWeightChart');
if (catCtx) {
new Chart(catCtx, { type: 'doughnut', data: { labels: <?php echo json_encode(array_keys($weight_by_category)); ?>, datasets: [{ data: <?php echo json_encode(array_values($weight_by_category)); ?>, backgroundColor: greenColors, borderWidth: 2, hoverOffset: 15 }] }, options: { responsive: true, maintainAspectRatio: false, plugins: { legend: { display: false }, datalabels: { display: false } } } });
new Chart(catCtx, { type: 'doughnut', data: { labels: <?php echo json_encode(array_keys($weight_by_category)); ?>, datasets: [{ data: <?php echo json_encode(array_values($weight_by_category)); ?>, backgroundColor: greenColors, borderWidth: 0, hoverOffset: 15 }] }, options: { responsive: true, maintainAspectRatio: false, plugins: { legend: { display: false }, datalabels: { display: false } } } });
}
const carrierCtx = document.getElementById('carrierWeightChart');
if (carrierCtx) {
new Chart(carrierCtx, { type: 'doughnut', data: { labels: <?php echo json_encode(array_keys($weight_by_carrier)); ?>, datasets: [{ data: <?php echo json_encode(array_values($weight_by_carrier)); ?>, backgroundColor: greenColors, borderWidth: 2, hoverOffset: 15 }] }, options: { responsive: true, maintainAspectRatio: false, plugins: { legend: { display: false }, datalabels: { display: false } } } });
new Chart(carrierCtx, { type: 'doughnut', data: { labels: <?php echo json_encode(array_keys($weight_by_carrier)); ?>, datasets: [{ data: <?php echo json_encode(array_values($weight_by_carrier)); ?>, backgroundColor: greenColors, borderWidth: 0, hoverOffset: 15 }] }, options: { responsive: true, maintainAspectRatio: false, plugins: { legend: { display: false }, datalabels: { display: false } } } });
}
// Collapsible Tree Logic