feat: add info field to articles for shop display
Added optional info text field to articles that can be managed in the backend and is displayed in the shop only when filled. The info appears in both card view and detail modal with an informative style. - Added info column to items table with migration - Updated backend edit form with textarea for info text - Modified API to include info field in bestand response - Enhanced shop frontend to display info badge when available Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -605,6 +605,9 @@ function render(items) {
|
||||
// Sale-Badge anzeigen
|
||||
const saleBadge = item.sale ? '<div class="sale-badge">SALE 🔥</div>' : '';
|
||||
|
||||
// Info-Text (nur wenn vorhanden)
|
||||
const infoText = item.info ? `<div class="card-info" style="margin-top: 8px; padding: 8px; background: rgba(243, 213, 42, 0.1); border-left: 3px solid var(--accent); border-radius: 4px; font-size: 12px; line-height: 1.4; color: var(--text);">ℹ️ ${item.info}</div>` : '';
|
||||
|
||||
return `
|
||||
<div class="card-tile">
|
||||
${saleBadge}
|
||||
@@ -615,6 +618,7 @@ function render(items) {
|
||||
<div class="card-title">${item.artikel}</div>
|
||||
<div class="card-price">${priceText}</div>
|
||||
<div class="card-sub">${item.rows.length} Größen</div>
|
||||
${infoText}
|
||||
${stockBadge}
|
||||
</div>
|
||||
<div class="card-actions">
|
||||
@@ -692,7 +696,9 @@ document.addEventListener("click", (e) => {
|
||||
media.innerHTML = img ? `<img src="${img}" alt="${artikel}">` : "";
|
||||
document.getElementById("detailTitle").textContent = artikel;
|
||||
document.getElementById("detailPrice").textContent = detailBtn.dataset.preis || "Preis auf Anfrage";
|
||||
document.getElementById("detailSizes").textContent = `${item.rows.length} Größen`;
|
||||
const sizesText = `${item.rows.length} Größen`;
|
||||
const infoText = item.info ? ` · ℹ️ ${item.info}` : '';
|
||||
document.getElementById("detailSizes").textContent = sizesText + infoText;
|
||||
const list = item.rows.map(r => {
|
||||
const stock = Number(r.gezaehlt) || 0;
|
||||
let stockInfo = '';
|
||||
|
||||
Reference in New Issue
Block a user