From 3c9add686491e9c1fc769866b61578a15539b84a Mon Sep 17 00:00:00 2001 From: data Date: Sun, 1 Mar 2026 09:57:23 +0100 Subject: [PATCH] =?UTF-8?q?PWA:=20FAB-Button=20auf=20Panel=201=20entfernt,?= =?UTF-8?q?=20L=C3=B6sch-Button=20f=C3=BCr=20Produktzeilen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - FAB (Plus-Button unten rechts) nur noch auf Panel 0 (STZ-Liste) sichtbar, Panel 1 hat bereits den Inline-Button "+ Leistung hinzufügen" - Lösch-Button (🗑️) für verbaute Produkte (order/added) im Product-Card-Header mit Bestätigungsdialog hinzugefügt - Cache-Busting auf v=2.7 Co-Authored-By: Claude Opus 4.6 --- css/pwa.css | 6 ++++++ js/pwa.js | 30 ++++++++++++++++++------------ pwa.php | 4 ++-- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/css/pwa.css b/css/pwa.css index e8a9f49..c8ede4e 100644 --- a/css/pwa.css +++ b/css/pwa.css @@ -459,6 +459,12 @@ body { align-items: flex-start; gap: 8px; } +.product-card-actions { + display: flex; + align-items: center; + gap: 8px; + flex-shrink: 0; +} .product-name { font-weight: 600; font-size: 14px; diff --git a/js/pwa.js b/js/pwa.js index 84d817f..95cfd0f 100644 --- a/js/pwa.js +++ b/js/pwa.js @@ -628,27 +628,18 @@ updateFab: function() { var $fab = $('#fab-add'); - var stz = this.data.stz; - var isDraft = stz && stz.status == 0; - // FAB auf Panel 0 (neuen STZ anlegen) und Panel 1 (Leistung hinzufuegen, nur Draft) + // FAB nur auf Panel 0 (neuen STZ anlegen) - Panel 1 hat eigenen Inline-Button if (this.state.activePanel === 0 && this.state.canWrite) { $fab.removeClass('hidden'); - } else if (this.state.activePanel === 1 && isDraft && this.state.canEditStz) { - $fab.removeClass('hidden'); } else { $fab.addClass('hidden'); } }, handleFabClick: function() { - switch (this.state.activePanel) { - case 0: - this.showCreateStzDialog(); - break; - case 1: - this.showAddLeistungDialog(); - break; + if (this.state.activePanel === 0) { + this.showCreateStzDialog(); } }, @@ -938,6 +929,16 @@ } }); + // Produkt loeschen + $panel.find('.btn-delete-product').on('click', function(e) { + e.stopPropagation(); + var id = $(this).data('id'); + var origin = $(this).data('origin'); + self.showConfirm('Produkt löschen?', 'Dieses Produkt wirklich vom Stundenzettel entfernen?', 'Löschen').then(function(ok) { + if (ok) self.deleteLine(id, origin); + }); + }); + // Produkt hinzufuegen $panel.find('#btn-add-product-inline').on('click', function() { self.showAddProductDialog(); @@ -1264,7 +1265,12 @@ html += '
' + self.escHtml(p.description) + '
'; } html += ''; + html += '
'; html += '' + self.getOriginLabel(p.origin) + ''; + if (isDraft && canWrite) { + html += ''; + } + html += '
'; html += ''; html += '
'; diff --git a/pwa.php b/pwa.php index 08ce0f3..f97f49a 100644 --- a/pwa.php +++ b/pwa.php @@ -38,7 +38,7 @@ $themeColor = getDolGlobalString('THEME_ELDY_TOPMENU_BACK1', '#4390dc'); - + @@ -160,7 +160,7 @@ $themeColor = getDolGlobalString('THEME_ELDY_TOPMENU_BACK1', '#4390dc'); authUrl: '' }; - +